idx
int64 0
60.3k
| question
stringlengths 101
6.21k
| target
stringlengths 7
803
|
|---|---|---|
57,500
|
public function requestColumn ( string $ propertyName , string $ columnName = null , array $ relatedComponents = array ( ) ) { $ determineColumnName = $ this -> determineColumnName ( $ propertyName , $ columnName === null , $ relatedComponents ) ; if ( $ columnName === null ) { $ columnName = $ determineColumnName ; } $ columnName = $ this -> namingStrategy -> buildColumnName ( $ propertyName , $ columnName ) ; $ this -> setupProcess -> registerColumnName ( $ columnName , $ this -> buildPropertyString ( $ propertyName ) , $ relatedComponents ) ; return $ columnName ; }
|
Request a column to write your data .
|
57,501
|
protected function getCollection ( $ type ) { $ collection = new ArrayCollection ( ) ; $ key = $ this -> config [ $ type ] [ 'key' ] ; $ hydrator = $ this -> getHydrator ( $ type ) ; $ filter = 'filter' . rtrim ( $ type , 's' ) ; $ entity = $ this -> getEntity ( $ type ) ; $ dataArray = $ this -> getData ( $ key ) ; if ( $ dataArray ) { foreach ( $ dataArray as $ data ) { $ data = $ this -> $ filter ( $ data ) ; if ( ! count ( $ data ) ) { continue ; } $ current = $ hydrator -> hydrate ( $ data , clone $ entity ) ; $ collection -> add ( $ current ) ; } } return $ collection ; }
|
Creates a collection of normalized embedded documents .
|
57,502
|
protected function getHydrator ( $ type ) { $ hydrator = isset ( $ this -> config [ $ type ] [ 'hydrator' ] ) ? $ this -> config [ $ type ] [ 'hydrator' ] : new EntityHydrator ( ) ; if ( is_string ( $ hydrator ) ) { $ this -> config [ $ type ] [ 'hydrator' ] = $ hydrator = new $ hydrator ( ) ; } return $ hydrator ; }
|
Gets a hydrator
|
57,503
|
protected function getEntity ( $ type ) { $ entity = isset ( $ this -> config [ $ type ] [ 'entity' ] ) ? $ this -> config [ $ type ] [ 'entity' ] : '\Cv\Entity\\' . ucfirst ( rtrim ( $ type , 's' ) ) ; if ( is_string ( $ entity ) ) { $ this -> config [ $ type ] [ 'entity' ] = $ entity = new $ entity ( ) ; } return $ entity ; }
|
Gets an entity for education or employment .
|
57,504
|
public function loadMetadataForClass ( \ ReflectionClass $ class ) { $ classMetadata = new MergeableClassMetadata ( $ class -> getName ( ) ) ; foreach ( $ class -> getProperties ( ) as $ reflectionProperty ) { $ propertyMetadata = new PropertyMetadata ( $ class -> getName ( ) , $ reflectionProperty -> getName ( ) ) ; $ annotation = $ this -> reader -> getPropertyAnnotation ( $ reflectionProperty , 'Zicht\Bundle\FileManagerBundle\Annotation\File' ) ; if ( null !== $ annotation ) { $ propertyMetadata -> fileManager = $ annotation -> settings ; } $ classMetadata -> addPropertyMetadata ( $ propertyMetadata ) ; } return $ classMetadata ; }
|
Loads the metadata for the class .
|
57,505
|
protected function preAssert ( Acl $ acl , RoleInterface $ role = null , ResourceInterface $ resource = null , $ privilege = null ) { return null ; }
|
Overwrite this to check some conditions before the event is triggered .
|
57,506
|
public function serialize ( ) { return serialize ( [ $ this -> id , $ this -> nameId , $ this -> institution , $ this -> email , $ this -> commonName , $ this -> preferredLocale ] ) ; }
|
Used so that we can serialize the Identity within the SAMLToken so we can store the token in a session . This to support persistent login
|
57,507
|
public function unserialize ( $ serialized ) { list ( $ this -> id , $ this -> nameId , $ this -> institution , $ this -> email , $ this -> commonName , $ this -> preferredLocale ) = unserialize ( $ serialized ) ; }
|
Used so that we can unserialize the Identity within the SAMLToken so that it can be loaded from the session for persistent login .
|
57,508
|
public function getConsent ( $ description ) { static $ codes = array ( ) ; if ( ! isset ( $ codes [ $ description ] ) ) { $ codes [ $ description ] = $ this -> _loadClass ( 'consentCode' , true , array ( $ description ) ) ; } return $ codes [ $ description ] ; }
|
Returns a single consent code object .
|
57,509
|
public function getCurrentURI ( $ subpath = '' ) { static $ uri ; if ( ! $ uri ) { $ uri = ( \ MUtil_Https :: on ( ) || $ this -> project -> isHttpsRequired ( ) ) ? 'https' : 'http' ; $ uri .= '://' ; $ uri .= isset ( $ _SERVER [ 'SERVER_NAME' ] ) ? $ _SERVER [ 'SERVER_NAME' ] : $ this -> project -> getConsoleUrl ( ) ; $ uri .= $ this -> basepath -> getBasePath ( ) ; } if ( $ subpath && ( $ subpath [ 0 ] != '/' ) ) { $ subpath = '/' . $ subpath ; } return $ uri . $ subpath ; }
|
Returns the current base site url optionally with a subpath .
|
57,510
|
public function getReceptionCode ( $ code ) { static $ codes = array ( ) ; if ( ! isset ( $ codes [ $ code ] ) ) { $ codes [ $ code ] = $ this -> _loadClass ( 'receptionCode' , true , array ( $ code ) ) ; } return $ codes [ $ code ] ; }
|
Returns a single reception code object .
|
57,511
|
protected function getConfigModel ( $ valueMask = true ) { if ( ! $ this -> _configModel ) { $ model = new \ MUtil_Model_TableModel ( 'gems__radius_config' , 'config' ) ; $ model -> setIfExists ( 'grcfg_ip' , 'label' , $ this -> translate -> _ ( 'IP address' ) , 'required' , true ) ; $ model -> setIfExists ( 'grcfg_port' , 'label' , $ this -> translate -> _ ( 'Port' ) , 'required' , true ) ; $ model -> setIfExists ( 'grcfg_secret' , 'label' , $ this -> translate -> _ ( 'Shared secret' ) , 'description' , $ this -> translate -> _ ( 'Enter only when changing' ) , 'elementClass' , 'password' , 'required' , false , 'repeatLabel' , $ this -> translate -> _ ( 'Repeat password' ) ) ; $ type = new \ Gems_Model_Type_EncryptedField ( $ this -> project , $ valueMask ) ; $ type -> apply ( $ model , 'grcfg_secret' ) ; $ this -> _configModel = $ model ; } return $ this -> _configModel ; }
|
Get a model to store the config
|
57,512
|
protected function getUserSelect ( $ login_name , $ organization ) { $ select = new \ Zend_Db_Select ( $ this -> db ) ; $ select -> from ( 'gems__user_logins' , array ( 'user_login_id' => 'gul_id_user' , 'user_two_factor_key' => 'gul_two_factor_key' , 'user_enable_2factor' => 'gul_enable_2factor' ) ) -> join ( 'gems__staff' , 'gul_login = gsf_login AND gul_id_organization = gsf_id_organization' , array ( 'user_id' => 'gsf_id_user' , 'user_login' => 'gsf_login' , 'user_email' => 'gsf_email' , 'user_first_name' => 'gsf_first_name' , 'user_surname_prefix' => 'gsf_surname_prefix' , 'user_last_name' => 'gsf_last_name' , 'user_gender' => 'gsf_gender' , 'user_group' => 'gsf_id_primary_group' , 'user_locale' => 'gsf_iso_lang' , 'user_logout' => 'gsf_logout_on_survey' , 'user_base_org_id' => 'gsf_id_organization' , ) ) -> join ( 'gems__groups' , 'gsf_id_primary_group = ggp_id_group' , array ( 'user_role' => 'ggp_role' , 'user_allowed_ip_ranges' => 'ggp_allowed_ip_ranges' , ) ) -> where ( 'ggp_group_active = 1' ) -> where ( 'gsf_active = 1' ) -> where ( 'gul_can_login = 1' ) -> where ( 'gul_login = ?' ) -> where ( 'gul_id_organization = ?' ) -> limit ( 1 ) ; return $ select ; }
|
Copied from \ Gems_User_StaffUserDefinition but left out the password link
|
57,513
|
public function loadConfig ( $ data ) { $ model = $ this -> getConfigModel ( false ) ; $ newData = $ model -> loadFirst ( array ( 'grcfg_id_organization' => $ data [ 'gor_id_organization' ] ) ) ; if ( empty ( $ newData ) ) { $ newData = $ model -> loadNew ( ) ; } $ newData [ 'grcfg_id_organization' ] = $ data [ 'gor_id_organization' ] ; return $ newData ; }
|
Handles loading the config for the given data
|
57,514
|
public function formatString ( $ input ) { if ( is_array ( $ input ) ) { $ input = join ( ', ' , $ input ) ; } $ output = strip_tags ( $ input ) ; $ output = str_replace ( array ( "'" , "\r" , "\n" ) , array ( "''" , ' ' , ' ' ) , $ output ) ; return $ output ; }
|
Formatting of strings for SPSS export . Enclose in single quotes and escape single quotes with a single quote
|
57,515
|
public function isValid ( $ value , $ context = array ( ) ) { $ this -> _setValue ( ( string ) $ value ) ; $ fieldSet = ( boolean ) isset ( $ context [ $ this -> _fieldName ] ) && $ context [ $ this -> _fieldName ] ; $ valueSet = ( boolean ) $ value ; if ( $ valueSet && ( ! $ fieldSet ) ) { return true ; } if ( ( ! $ valueSet ) && $ fieldSet ) { return true ; } $ this -> _error ( self :: NEITHER ) ; return false ; }
|
Defined by \ Zend_Validate_Interface
|
57,516
|
protected function exportBatch ( $ data ) { $ filter = $ this -> getSearchFilter ( ) ; if ( $ data ) { $ batch = $ this -> loader -> getTaskRunnerBatch ( 'export_surveys' ) ; $ models = $ this -> getExportModels ( $ data [ 'gto_id_survey' ] , $ filter , $ data ) ; $ batch -> setVariable ( 'model' , $ models ) ; if ( ! $ batch -> count ( ) ) { $ batch -> minimalStepDurationMs = 2000 ; $ batch -> finishUrl = $ this -> view -> url ( array ( 'step' => 'download' ) ) ; $ batch -> setSessionVariable ( 'files' , array ( ) ) ; foreach ( $ data [ 'gto_id_survey' ] as $ surveyId ) { $ batch -> addTask ( 'Export_ExportCommand' , $ data [ 'type' ] , 'addExport' , $ data , $ surveyId ) ; } $ batch -> addTask ( 'addTask' , 'Export_ExportCommand' , $ data [ 'type' ] , 'finalizeFiles' ) ; $ export = $ this -> loader -> getExport ( ) -> getExport ( $ data [ 'type' ] ) ; if ( $ snippet = $ export -> getHelpSnippet ( ) ) { $ this -> addSnippet ( $ snippet ) ; } $ batch -> autoStart = true ; $ this -> accesslog -> logChange ( $ this -> getRequest ( ) , null , $ data + $ filter ) ; } if ( $ batch -> run ( $ this -> request ) ) { exit ; } else { $ controller = $ this ; if ( $ batch -> isFinished ( ) ) { } else { if ( $ batch -> count ( ) ) { $ controller -> html -> append ( $ batch -> getPanel ( $ controller -> view , $ batch -> getProgressPercentage ( ) . '%' ) ) ; } else { $ controller -> html -> pInfo ( $ controller -> _ ( 'Nothing to do.' ) ) ; } $ controller -> html -> pInfo ( ) -> a ( \ MUtil_Html_UrlArrayAttribute :: rerouteUrl ( $ this -> getRequest ( ) , array ( 'action' => 'index' , 'step' => false ) ) , array ( 'class' => 'actionlink' ) , $ this -> _ ( 'Back' ) ) ; } } } }
|
Performs the export step
|
57,517
|
protected function exportDownload ( ) { $ this -> view -> layout ( ) -> disableLayout ( ) ; $ this -> _helper -> viewRenderer -> setNoRender ( true ) ; $ batch = $ this -> loader -> getTaskRunnerBatch ( 'export_surveys' ) ; $ file = $ batch -> getSessionVariable ( 'file' ) ; foreach ( $ file [ 'headers' ] as $ header ) { header ( $ header ) ; } while ( ob_get_level ( ) ) { ob_end_clean ( ) ; } readfile ( $ file [ 'file' ] ) ; unlink ( $ file [ 'file' ] ) ; exit ; }
|
Performs the download step
|
57,518
|
protected function getSingleTokenData ( ) { $ this -> otherTokenData = $ this -> multipleTokenData ; $ singleTokenData = array_shift ( $ this -> otherTokenData ) ; return $ singleTokenData ; }
|
Get the default token Id from an array of tokenids . Usually the first token .
|
57,519
|
public function getTokenName ( array $ tokenData = null ) { $ data [ ] = $ tokenData [ 'grs_first_name' ] ; $ data [ ] = $ tokenData [ 'grs_surname_prefix' ] ; $ data [ ] = $ tokenData [ 'grs_last_name' ] ; $ data = array_filter ( array_map ( 'trim' , $ data ) ) ; return implode ( ' ' , $ data ) ; }
|
Returns the name of the user mentioned in this token in human - readable format
|
57,520
|
public function addActivity ( $ name , $ organizationId ) { $ model = new \ MUtil_Model_TableModel ( 'gems__agenda_activities' ) ; \ Gems_Model :: setChangeFieldsByPrefix ( $ model , 'gaa' ) ; $ values = array ( 'gaa_name' => $ name , 'gaa_id_organization' => $ organizationId , 'gaa_match_to' => $ name , 'gaa_active' => 1 , 'gaa_filter' => 0 , ) ; $ result = $ model -> save ( $ values ) ; $ this -> cache -> clean ( \ Zend_Cache :: CLEANING_MODE_MATCHING_ANY_TAG , array ( 'activity' , 'activities' ) ) ; return $ result ; }
|
Add Activities to the table
|
57,521
|
public function getActiveAppointments ( $ respondentId , $ organizationId , $ patientNr = null , $ where = null ) { if ( $ where ) { $ where = "($where) AND " ; } else { $ where = "" ; } $ where .= sprintf ( 'gap_status IN (%s)' , $ this -> getStatusKeysActiveDbQuoted ( ) ) ; return $ this -> getAppointments ( $ respondentId , $ organizationId , $ patientNr , $ where ) ; }
|
Get all active respondents for this user
|
57,522
|
public function getAppointmentDisplay ( array $ row ) { $ date = new \ MUtil_Date ( $ row [ 'gap_admission_time' ] , 'yyyy-MM-dd HH:mm:ss' ) ; $ results [ ] = $ date -> toString ( $ this -> appointmentDisplayFormat ) ; if ( $ row [ 'gaa_name' ] ) { $ results [ ] = $ row [ 'gaa_name' ] ; } if ( $ row [ 'gapr_name' ] ) { $ results [ ] = $ row [ 'gapr_name' ] ; } if ( $ row [ 'glo_name' ] ) { $ results [ ] = $ row [ 'glo_name' ] ; } return implode ( $ this -> _ ( '; ' ) , $ results ) ; }
|
Overrule this function to adapt the display of the agenda items for each project
|
57,523
|
public function getAppointments ( $ respondentId , $ organizationId , $ patientNr = null , $ where = null ) { $ select = $ this -> _getAppointmentSelect ( ) ; if ( $ where ) { $ select -> where ( $ where ) ; } if ( $ respondentId ) { $ select -> where ( 'gap_id_user = ?' , $ respondentId ) -> where ( 'gap_id_organization = ?' , $ organizationId ) ; } else { $ from = $ select -> getPart ( \ Zend_Db_Select :: FROM ) ; if ( ! isset ( $ from [ 'gems__respondent2org' ] ) ) { $ select -> joinInner ( 'gems__respondent2org' , 'gap_id_user = gr2o_id_user AND gap_id_organization = gr2o_id_organization' , array ( ) ) ; } $ select -> where ( 'gr2o_patient_nr = ?' , $ patientNr ) -> where ( 'gr2o_id_organization = ?' , $ organizationId ) ; } $ rows = $ this -> db -> fetchAll ( $ select ) ; if ( ! $ rows ) { return array ( ) ; } $ results = array ( ) ; foreach ( $ rows as $ row ) { $ results [ $ row [ 'gap_id_appointment' ] ] = $ this -> getAppointmentDisplay ( $ row ) ; } return $ results ; }
|
Get all appointments for a respondent
|
57,524
|
public function getAppointmentsForEpisode ( $ episode ) { $ select = $ this -> _getAppointmentSelect ( ) ; if ( $ episode instanceof EpisodeOfCare ) { $ episodeId = $ episode -> getId ( ) ; } else { $ episodeId = $ episode ; } $ select -> where ( 'gap_id_episode = ?' , $ episodeId ) ; $ rows = $ this -> db -> fetchAll ( $ select ) ; if ( ! $ rows ) { return array ( ) ; } $ results = array ( ) ; foreach ( $ rows as $ row ) { $ results [ $ row [ 'gap_id_appointment' ] ] = $ this -> getAppointment ( $ row ) ; } return $ results ; }
|
Get all appointments for an episode
|
57,525
|
public function getEpisodeStatusCodesActive ( ) { $ codes = array ( 'A' => $ this -> _ ( 'Active' ) , 'F' => $ this -> _ ( 'Finished' ) , 'O' => $ this -> _ ( 'On hold' ) , 'P' => $ this -> _ ( 'Planned' ) , 'W' => $ this -> _ ( 'Waitlist' ) , ) ; asort ( $ codes ) ; return $ codes ; }
|
Get the status codes for active episode of care items
|
57,526
|
public function getEpisodesAsOptions ( array $ episodes ) { $ options = [ ] ; foreach ( $ episodes as $ id => $ episode ) { if ( $ episode instanceof EpisodeOfCare ) { $ options [ $ id ] = $ episode -> getDisplayString ( ) ; } } return $ options ; }
|
Get the options list episodes for episodes
|
57,527
|
public function getFilterList ( ) { $ cacheId = __CLASS__ . '_' . __FUNCTION__ ; $ output = $ this -> cache -> load ( $ cacheId ) ; if ( $ output ) { return $ output ; } $ output = $ this -> db -> fetchPairs ( "SELECT gaf_id, COALESCE(gaf_manual_name, gaf_calc_name) " . "FROM gems__appointment_filters WHERE gaf_active = 1 ORDER BY gaf_id_order" ) ; $ this -> cache -> save ( $ output , $ cacheId , array ( 'appointment_filters' ) ) ; return $ output ; }
|
Load the list of assignable filters
|
57,528
|
protected function getFieldData ( ) { return array ( 'gap_id_organization' => array ( 'label' => $ this -> _ ( 'Organization' ) , 'tableName' => 'gems__organizations' , 'tableId' => 'gor_id_organization' , 'tableLikeFilter' => "gor_active = 1 AND gor_name LIKE '%s'" , ) , 'gap_source' => array ( 'label' => $ this -> _ ( 'Source of appointment' ) , ) , 'gap_id_attended_by' => array ( 'label' => $ this -> _ ( 'With' ) , 'tableName' => 'gems__agenda_staff' , 'tableId' => 'gas_id_staff' , 'tableLikeFilter' => "gas_active = 1 AND gas_name LIKE '%s'" , ) , 'gap_id_referred_by' => array ( 'label' => $ this -> _ ( 'Referrer' ) , 'tableName' => 'gems__agenda_staff' , 'tableId' => 'gas_id_staff' , 'tableLikeFilter' => "gas_active = 1 AND gas_name LIKE '%s'" , ) , 'gap_id_activity' => array ( 'label' => $ this -> _ ( 'Activity' ) , 'tableName' => 'gems__agenda_activities' , 'tableId' => 'gaa_id_activity' , 'tableLikeFilter' => "gaa_active = 1 AND gaa_name LIKE '%s'" , ) , 'gap_id_procedure' => array ( 'label' => $ this -> _ ( 'Procedure' ) , 'tableName' => 'gems__agenda_procedures' , 'tableId' => 'gapr_id_procedure' , 'tableLikeFilter' => "gapr_active = 1 AND gapr_name LIKE '%s'" , ) , 'gap_id_location' => array ( 'label' => $ this -> _ ( 'Location' ) , 'tableName' => 'gems__locations' , 'tableId' => 'glo_id_location' , 'tableLikeFilter' => "glo_active = 1 AND glo_name LIKE '%s'" , ) , 'gap_subject' => array ( 'label' => $ this -> _ ( 'Subject' ) , ) , ) ; }
|
Get a structured nested array contain information on all the appointment
|
57,529
|
public function getFilter ( $ filterId ) { static $ filters = array ( ) ; if ( isset ( $ filters [ $ filterId ] ) ) { return $ filters [ $ filterId ] ; } $ found = $ this -> getFilters ( "SELECT * FROM gems__appointment_filters LEFT JOIN gems__track_appointments ON gaf_id = gtap_filter_id WHERE gaf_active = 1 AND gaf_id = $filterId LIMIT 1" ) ; if ( $ found ) { $ filters [ $ filterId ] = reset ( $ found ) ; return $ filters [ $ filterId ] ; } }
|
Get a filter from the database
|
57,530
|
public function getFilters ( $ sql ) { $ classes = array ( ) ; $ filterRows = $ this -> db -> fetchAll ( $ sql ) ; $ output = array ( ) ; foreach ( $ filterRows as $ key => $ filter ) { $ className = $ filter [ 'gaf_class' ] ; if ( ! isset ( $ classes [ $ className ] ) ) { $ classes [ $ className ] = $ this -> newFilterObject ( $ className ) ; } $ filterObject = clone $ classes [ $ className ] ; if ( $ filterObject instanceof AppointmentFilterInterface ) { $ filterObject -> exchangeArray ( $ filter ) ; $ output [ $ key ] = $ filterObject ; } } return $ output ; }
|
Get the filters from the database
|
57,531
|
public function getLocations ( $ orgId = null ) { $ orgId = intval ( $ orgId ) ; $ cacheId = __CLASS__ . '_' . __FUNCTION__ . '_' . $ orgId ; if ( $ results = $ this -> cache -> load ( $ cacheId ) ) { return $ results ; } $ select = $ this -> db -> select ( ) ; $ select -> from ( 'gems__locations' , array ( 'glo_id_location' , 'glo_name' ) ) -> order ( 'glo_name' ) ; if ( $ orgId ) { $ select -> where ( 'glo_active = 1' ) ; $ select -> where ( "glo_organizations LIKE '%:$orgId:%'" ) ; } $ results = $ this -> db -> fetchPairs ( $ select ) ; $ this -> cache -> save ( $ results , $ cacheId , array ( 'locations' ) ) ; return $ results ; }
|
Returns an array with identical key = > value pairs containing care provision locations .
|
57,532
|
public function getTrackCreateOptions ( ) { return [ 0 => $ this -> _ ( 'Do nothing' ) , 4 => $ this -> _ ( 'Create new on minimum start date difference' ) , 3 => $ this -> _ ( 'Create always (unless the appointment already assigned)' ) , 2 => $ this -> _ ( 'Create new on minimum end date difference' ) , 5 => $ this -> _ ( 'Create new when all surveys have been completed' ) , 1 => $ this -> _ ( 'Create new when all surveys have been completed and on minimum end date' ) , ] ; }
|
Get the element that allows to create a track from an appointment
|
57,533
|
public function getTypeCodes ( ) { return array ( 'A' => $ this -> _ ( 'Ambulatory' ) , 'E' => $ this -> _ ( 'Emergency' ) , 'F' => $ this -> _ ( 'Field' ) , 'H' => $ this -> _ ( 'Home' ) , 'I' => $ this -> _ ( 'Inpatient' ) , 'S' => $ this -> _ ( 'Short stay' ) , 'V' => $ this -> _ ( 'Virtual' ) , ) ; }
|
Get the type codes for agenda items
|
57,534
|
protected function loadDefaultFilters ( ) { if ( $ this -> _filters ) { return $ this -> _filters ; } $ cacheId = __CLASS__ . '_' . __FUNCTION__ ; $ output = $ this -> cache -> load ( $ cacheId ) ; if ( $ output ) { foreach ( $ output as $ key => $ filterObject ) { if ( $ filterObject instanceof \ MUtil_Registry_TargetInterface ) { $ this -> applySource ( $ filterObject ) ; } $ this -> _filters [ $ key ] = $ filterObject ; } return $ this -> _filters ; } $ this -> _filters = $ this -> getFilters ( "SELECT * FROM gems__appointment_filters INNER JOIN gems__track_appointments ON gaf_id = gtap_filter_id INNER JOIN gems__tracks ON gtap_id_track = gtr_id_track WHERE gaf_active = 1 AND gtr_active = 1 AND gtr_date_start <= CURRENT_DATE AND (gtr_date_until IS NULL OR gtr_date_until >= CURRENT_DATE) ORDER BY gaf_id_order, gtap_id_order" ) ; $ this -> cache -> save ( $ this -> _filters , $ cacheId , array ( 'appointment_filters' , 'tracks' ) ) ; return $ this -> _filters ; }
|
Load the filters from cache or elsewhere
|
57,535
|
public function matchHealthcareStaff ( $ name , $ organizationId , $ create = true ) { $ cacheId = __CLASS__ . '_' . __FUNCTION__ ; $ matches = $ this -> cache -> load ( $ cacheId ) ; if ( ! $ matches ) { $ matches = array ( ) ; $ select = $ this -> db -> select ( ) ; $ select -> from ( 'gems__agenda_staff' ) -> order ( 'gas_name' ) ; $ result = $ this -> db -> fetchAll ( $ select ) ; foreach ( $ result as $ row ) { foreach ( explode ( '|' , $ row [ 'gas_match_to' ] ) as $ match ) { $ matches [ $ match ] [ $ row [ 'gas_id_organization' ] ] = $ row [ 'gas_filter' ] ? false : $ row [ 'gas_id_staff' ] ; } } $ this -> cache -> save ( $ matches , $ cacheId , array ( 'staff' ) ) ; } if ( isset ( $ matches [ $ name ] ) ) { if ( $ organizationId ) { if ( isset ( $ matches [ $ name ] [ $ organizationId ] ) ) { return $ matches [ $ name ] [ $ organizationId ] ; } } else { return reset ( $ matches [ $ name ] ) ; } } if ( ! $ create ) { return null ; } $ result = $ this -> addHealthcareStaff ( $ name , $ organizationId ) ; return $ result [ 'gas_filter' ] ? false : $ result [ 'gas_id_staff' ] ; }
|
Find a healt care provider for the name and organization .
|
57,536
|
public function matchLocation ( $ name , $ organizationId , $ create = true ) { $ cacheId = __CLASS__ . '_' . __FUNCTION__ ; $ matches = $ this -> cache -> load ( $ cacheId ) ; if ( ! $ matches ) { $ matches = array ( ) ; $ select = $ this -> db -> select ( ) ; $ select -> from ( 'gems__locations' ) -> order ( 'glo_name' ) ; $ result = $ this -> db -> fetchAll ( $ select ) ; foreach ( $ result as $ row ) { foreach ( explode ( '|' , $ row [ 'glo_match_to' ] ) as $ match ) { foreach ( explode ( ':' , trim ( $ row [ 'glo_organizations' ] , ':' ) ) as $ subOrg ) { $ matches [ $ match ] [ $ subOrg ] = $ row ; } } } $ this -> cache -> save ( $ matches , $ cacheId , array ( 'locations' ) ) ; } if ( isset ( $ matches [ $ name ] ) ) { if ( $ organizationId ) { if ( isset ( $ matches [ $ name ] [ $ organizationId ] ) ) { return $ matches [ $ name ] [ $ organizationId ] ; } } else { return reset ( $ matches [ $ name ] ) ; } } else { $ matches [ $ name ] = null ; } if ( ! $ create ) { return null ; } $ result = $ this -> addLocation ( $ name , $ organizationId , $ matches [ $ name ] ) ; return $ result ; }
|
Find a location for the name and organization .
|
57,537
|
public function matchProcedure ( $ name , $ organizationId , $ create = true ) { $ cacheId = __CLASS__ . '_' . __FUNCTION__ ; $ matches = $ this -> cache -> load ( $ cacheId ) ; if ( ! $ matches ) { $ matches = array ( ) ; $ select = $ this -> db -> select ( ) ; $ select -> from ( 'gems__agenda_procedures' , array ( 'gapr_id_procedure' , 'gapr_match_to' , 'gapr_id_organization' , 'gapr_filter' , ) ) ; $ result = $ this -> db -> fetchAll ( $ select ) ; foreach ( $ result as $ row ) { if ( null === $ row [ 'gapr_id_organization' ] ) { $ key = 'null' ; } else { $ key = $ row [ 'gapr_id_organization' ] ; } foreach ( explode ( '|' , $ row [ 'gapr_match_to' ] ) as $ match ) { $ matches [ $ match ] [ $ key ] = $ row [ 'gapr_filter' ] ? false : $ row [ 'gapr_id_procedure' ] ; } } $ this -> cache -> save ( $ matches , $ cacheId , array ( 'procedures' ) ) ; } if ( isset ( $ matches [ $ name ] ) ) { if ( isset ( $ matches [ $ name ] [ $ organizationId ] ) ) { return $ matches [ $ name ] [ $ organizationId ] ; } if ( isset ( $ matches [ $ name ] [ 'null' ] ) ) { return $ matches [ $ name ] [ 'null' ] ; } } if ( ! $ create ) { return null ; } $ result = $ this -> addProcedure ( $ name , $ organizationId ) ; return $ result [ 'gapr_filter' ] ? false : $ result [ 'gapr_id_procedure' ] ; }
|
Find a procedure code for the name and organization .
|
57,538
|
public function generate ( ) { $ str = '' ; $ keysize = strlen ( $ this -> _alphabet ) ; for ( $ i = 0 ; $ i < $ this -> _length ; ++ $ i ) { $ str .= $ this -> _alphabet [ \ Sodium \ randombytes_uniform ( $ keysize ) ] ; } return $ str ; }
|
Generates a new identifier .
|
57,539
|
protected function configure ( array $ config = [ ] ) { foreach ( $ config as $ key => $ value ) { $ method = 'set' . $ key ; if ( method_exists ( $ this , $ method ) ) { $ this -> $ method ( $ value ) ; } } }
|
Configures the generator instance .
|
57,540
|
public function addFormTabs ( $ parentBridge , $ name , $ arrayOrKey1 = null ) { $ options = func_get_args ( ) ; $ options = \ MUtil_Ra :: pairs ( $ options , 2 ) ; if ( isset ( $ options [ 'form' ] ) ) { $ form = $ options [ 'form' ] ; unset ( $ options [ 'form' ] ) ; } else { $ formClass = get_class ( $ parentBridge -> getForm ( ) ) ; $ form = new $ formClass ( ) ; } $ submodel = $ parentBridge -> getModel ( ) -> get ( $ name , 'model' ) ; if ( $ submodel instanceof \ MUtil_Model_ModelAbstract ) { $ bridge = $ submodel -> getBridgeFor ( 'form' , $ form ) ; foreach ( $ submodel -> getItemsOrdered ( ) as $ itemName ) { if ( ! $ form -> getElement ( $ name ) ) { if ( $ submodel -> has ( $ itemName , 'label' ) ) { $ bridge -> add ( $ itemName ) ; } else { $ bridge -> addHidden ( $ itemName ) ; } } } } $ form -> activateJQuery ( ) ; $ element = new \ Gems_Form_Element_Tabs ( $ form , $ name , $ options ) ; $ parentBridge -> getForm ( ) -> addElement ( $ element ) ; return $ element ; }
|
Adds a form multiple times in a table
|
57,541
|
public function createBodyElement ( $ name , $ label , $ required = false , $ hidden = false , $ mailFields = array ( ) , $ mailFieldsLabel = false ) { if ( $ hidden ) { return new \ Zend_Form_Element_Hidden ( $ name ) ; } $ options [ 'required' ] = $ required ; $ options [ 'label' ] = $ label ; $ mailBody = new \ Gems_Form_Element_CKEditor ( $ name , $ options ) ; $ mailBody -> config [ 'availablefields' ] = $ mailFields ; if ( $ mailFieldsLabel ) { $ mailBody -> config [ 'availablefieldsLabel' ] = $ mailFieldsLabel ; } else { $ mailBody -> config [ 'availablefieldsLabel' ] = $ this -> translate -> _ ( 'Fields' ) ; } $ mailBody -> config [ 'extraPlugins' ] .= ',availablefields' ; $ mailBody -> config [ 'toolbar' ] [ ] = array ( 'availablefields' ) ; return new \ Gems_Form_Element_CKEditor ( $ name , $ options ) ; }
|
Create an HTML Body element with CKEditor
|
57,542
|
public function createMethodElement ( ) { $ multiOptions = $ this -> util -> getTranslated ( ) -> getBulkMailProcessOptions ( ) ; $ options = array ( 'label' => $ this -> translate -> _ ( 'Method' ) , 'multiOptions' => $ multiOptions , 'required' => true , ) ; return $ this -> _form -> createElement ( 'radio' , 'multi_method' , $ options ) ; }
|
Create a multioption select with the different mail process options
|
57,543
|
public function createPreviewHtmlElement ( $ label = false ) { if ( $ label ) { $ options [ 'label' ] = $ this -> translate -> _ ( $ label ) ; } else { $ options [ 'label' ] = $ this -> translate -> _ ( 'Preview HTML' ) ; } $ options [ 'nohidden' ] = true ; return $ this -> _form -> createElement ( 'Html' , 'preview_html' , $ options ) ; }
|
Create the container that holds the preview Email HTML text .
|
57,544
|
public function createPreviewTextElement ( ) { $ options [ 'label' ] = $ this -> translate -> _ ( 'Preview Text' ) ; $ options [ 'nohidden' ] = true ; return $ this -> _form -> createElement ( 'Html' , 'preview_text' , $ options ) ; }
|
Create the container that holds the preview Email Plain text .
|
57,545
|
protected function setShowTableFooter ( \ MUtil_Model_Bridge_VerticalTableBridge $ bridge , \ MUtil_Model_ModelAbstract $ model ) { $ footer = $ bridge -> tfrow ( ) ; $ footer [ ] = $ this -> getQuestion ( ) ; $ footer [ ] = ' ' ; $ footer -> actionLink ( array ( $ this -> confirmParameter => 1 ) , $ this -> _ ( 'Yes' ) ) ; $ footer [ ] = ' ' ; $ footer -> actionLink ( $ this -> findMenuItem ( $ this -> request -> getControllerName ( ) , $ this -> abortAction ) -> toHRefAttribute ( $ this -> request ) , $ this -> _ ( 'No' ) ) ; }
|
Use findmenuitem for the abort action so we get the right id appended
|
57,546
|
public function startImport ( ) { if ( $ this -> _targetModel instanceof \ MUtil_Model_ModelAbstract ) { $ fields = array ( 'gap_id_attended_by' , 'gap_id_referred_by' , 'gap_id_activity' , 'gap_id_procedure' , 'gap_id_location' , ) ; foreach ( $ fields as $ name ) { $ this -> _targetModel -> del ( $ name , 'multiOptions' ) ; } } return parent :: startImport ( ) ; }
|
Prepare for the import .
|
57,547
|
public function afterImport ( \ MUtil_Task_TaskBatch $ batch , \ MUtil_Form_Element_Html $ element ) { $ text = parent :: afterImport ( $ batch , $ element ) ; $ data = $ this -> formData ; unset ( $ data [ 'button_spacer' ] , $ data [ 'current_step' ] , $ data [ $ this -> csrfId ] ) ; $ data [ 'localfile' ] = basename ( $ this -> _session -> localfile ) ; $ data [ 'extension' ] = $ this -> _session -> extension ; $ data [ 'failureDirectory' ] = '...' . substr ( $ this -> importer -> getFailureDirectory ( ) , - 30 ) ; $ data [ 'longtermFilename' ] = basename ( $ this -> importer -> getLongtermFilename ( ) ) ; $ data [ 'successDirectory' ] = '...' . substr ( $ this -> importer -> getSuccessDirectory ( ) , - 30 ) ; $ data [ 'tempDirectory' ] = '...' . substr ( $ this -> tempDirectory , - 30 ) ; $ data [ 'importTranslator' ] = get_class ( $ this -> importer -> getImportTranslator ( ) ) ; $ data [ 'sourceModelClass' ] = get_class ( $ this -> sourceModel ) ; $ data [ 'targetModelClass' ] = get_class ( $ this -> targetModel ) ; ksort ( $ data ) ; $ this -> accesslog -> logChange ( $ this -> request , null , array_filter ( $ data ) ) ; }
|
Hook for after save
|
57,548
|
public function isAvailable ( ) { try { $ result = $ this -> get ( '/' , $ this -> getGuzzleOptions ( ) ) ; if ( $ result -> getStatusCode ( ) == 200 ) { return true ; } } catch ( RequestException $ ex ) { $ msg = sprintf ( "Tika unavailable - %s" , $ ex -> getMessage ( ) ) ; Injector :: inst ( ) -> get ( LoggerInterface :: class ) -> info ( $ msg ) ; return false ; } }
|
Detect if the service is available
|
57,549
|
public function getVersion ( ) { $ response = $ this -> get ( 'version' , $ this -> getGuzzleOptions ( ) ) ; $ version = 0.0 ; if ( $ response -> getStatusCode ( ) == 200 && preg_match ( '/Apache Tika (?<version>[\.\d]+)/' , $ response -> getBody ( ) , $ matches ) ) { $ version = ( float ) $ matches [ 'version' ] ; } return $ version ; }
|
Get version code
|
57,550
|
public function getSupportedMimes ( ) { if ( $ this -> mimes ) { return $ this -> mimes ; } $ response = $ this -> get ( 'mime-types' , $ this -> getGuzzleOptions ( [ 'headers' => [ 'Accept' => 'application/json' , ] , ] ) ) ; return $ this -> mimes = Convert :: json2array ( $ response -> getBody ( ) ) ; }
|
Gets supported mime data . May include aliased mime types .
|
57,551
|
public function tika ( $ file ) { $ text = null ; try { $ response = $ this -> put ( 'tika' , $ this -> getGuzzleOptions ( [ 'headers' => [ 'Accept' => 'text/plain' , ] , 'body' => file_get_contents ( $ file ) , ] ) ) ; $ text = $ response -> getBody ( ) ; } catch ( RequestException $ e ) { $ msg = sprintf ( 'TikaRestClient was not able to process %s. Response: %s %s.' , $ file , $ e -> getResponse ( ) -> getStatusCode ( ) , $ e -> getResponse ( ) -> getReasonPhrase ( ) ) ; $ body = $ e -> getResponse ( ) -> getBody ( ) ; if ( $ body ) { $ msg .= ' Body: ' . $ body ; } Injector :: inst ( ) -> get ( LoggerInterface :: class ) -> info ( $ msg ) ; } return ( string ) $ text ; }
|
Extract text content from a given file . Logs a notice - level error if the document can t be parsed .
|
57,552
|
protected function getGuzzleOptions ( $ options = [ ] ) { if ( ! empty ( $ this -> options [ 'username' ] ) && ! empty ( $ this -> options [ 'password' ] ) ) { $ options [ 'auth' ] = [ $ this -> options [ 'username' ] , $ this -> options [ 'password' ] ] ; } return $ options ; }
|
Assembles an array of request options to pass to Guzzle
|
57,553
|
protected function addStepFileImport ( \ MUtil_Model_Bridge_FormBridgeInterface $ bridge , \ MUtil_Model_ModelAbstract $ model ) { $ this -> _session -> importData = null ; $ this -> displayHeader ( $ bridge , $ this -> _ ( 'Upload a track definition file.' ) , 'h3' ) ; $ this -> addItems ( $ bridge , 'trackFile' , 'gtr_id_track' ) ; $ element = $ bridge -> getForm ( ) -> getElement ( 'trackFile' ) ; if ( $ element instanceof \ Zend_Form_Element_File ) { if ( file_exists ( $ this -> _session -> localfile ) ) { unlink ( $ this -> _session -> localfile ) ; } $ element -> addFilter ( new \ Zend_Filter_File_Rename ( array ( 'target' => $ this -> _session -> localfile , 'overwrite' => true ) ) ) ; $ uploadFileName = $ element -> getFileName ( ) ; if ( $ this -> request -> isPost ( ) && $ uploadFileName && $ element -> isValid ( null ) ) { if ( ! $ element -> receive ( ) ) { throw new \ MUtil_Model_ModelException ( sprintf ( $ this -> _ ( "Error retrieving file '%s'." ) , $ element -> getFileName ( ) ) ) ; } $ this -> _session -> importData = null ; $ this -> _session -> uploadFileName = basename ( $ uploadFileName ) ; } } }
|
Add the elements from the model to the bridge for file upload step
|
57,554
|
protected function displayHeader ( \ MUtil_Model_Bridge_FormBridgeInterface $ bridge , $ header , $ tagName = 'h2' ) { static $ count = 0 ; $ count += 1 ; $ element = $ bridge -> getForm ( ) -> createElement ( 'html' , 'step_header_' . $ count ) ; $ element -> $ tagName ( $ header ) ; $ bridge -> addElement ( $ element ) ; }
|
Display a header
|
57,555
|
protected function getFormTitle ( $ step ) { if ( $ this -> trackEngine ) { return sprintf ( $ this -> _ ( 'Merge import into "%s" track. Step %d of %d.' ) , $ this -> trackEngine -> getTrackName ( ) , $ step , $ this -> getStepCount ( ) ) ; } return sprintf ( $ this -> _ ( 'New track import. Step %d of %d.' ) , $ step , $ this -> getStepCount ( ) ) ; }
|
Get the title at the top of the form
|
57,556
|
public static function initialize ( $ target , $ parameters ) { if ( is_array ( $ parameters ) ) { foreach ( $ parameters as $ key => $ value ) { $ method = 'set' . ucfirst ( static :: camelCase ( $ key ) ) ; if ( method_exists ( $ target , $ method ) ) { $ target -> $ method ( $ value ) ; } } } }
|
Initialize an object with a given array of parameters
|
57,557
|
public static function getMailerClassName ( $ className ) { if ( class_exists ( $ className ) ) { return $ className ; } $ fullyQualified = '\\Omnimail\\' . str_replace ( '_' , '\\' , $ className ) ; if ( ! class_exists ( $ fullyQualified ) ) { $ fullyQualified = $ fullyQualified . '\\Mailer' ; if ( ! class_exists ( $ fullyQualified ) ) { throw new \ Exception ( "Class '${className}' not found" ) ; } } return $ fullyQualified ; }
|
Resolve a short Mailer name to a full namespaced Mailer class .
|
57,558
|
protected static function get_extractor_classes ( ) { if ( self :: $ sorted_extractor_classes ) { return self :: $ sorted_extractor_classes ; } $ classes = ClassInfo :: subclassesFor ( __CLASS__ ) ; array_shift ( $ classes ) ; $ classPriorities = [ ] ; foreach ( $ classes as $ class ) { $ classPriorities [ $ class ] = Config :: inst ( ) -> get ( $ class , 'priority' ) ; } arsort ( $ classPriorities ) ; $ sortedClasses = array_keys ( $ classPriorities ) ; return self :: $ sorted_extractor_classes = $ sortedClasses ; }
|
Gets the list of prioritised extractor classes
|
57,559
|
public static function for_file ( $ file ) { if ( ! $ file || ( is_string ( $ file ) && ! file_exists ( $ file ) ) ) { return null ; } if ( is_string ( $ file ) ) { $ fileObject = File :: create ( ) ; $ fileObject -> setFromLocalFile ( $ file ) ; $ file = $ fileObject ; } $ extension = $ file -> getExtension ( ) ; $ mime = $ file -> getMimeType ( ) ; foreach ( self :: get_extractor_classes ( ) as $ className ) { $ extractor = self :: get_extractor ( $ className ) ; if ( ! $ extractor -> isAvailable ( ) ) { continue ; } if ( $ extension && $ extractor -> supportsExtension ( $ extension ) ) { return $ extractor ; } if ( $ mime && $ extractor -> supportsMime ( $ mime ) ) { return $ extractor ; } } }
|
Given a File object decide which extractor instance to use to handle it
|
57,560
|
public function getRelation ( $ respondentId , $ relationId ) { $ filter = array ( 'grr_id_respondent' => $ respondentId , 'grr_id' => $ relationId ) ; $ data = $ this -> loadFirst ( $ filter ) ; if ( ! $ data ) { $ data = array ( ) ; } $ relationObject = $ this -> loader -> getInstance ( 'Model_RespondentRelationInstance' , $ this , $ data ) ; return $ relationObject ; }
|
Return an object for a row of this model
|
57,561
|
public function getRelationsFor ( $ respondentId , $ patientNr = null , $ organizationId = null , $ onlyActive = true ) { static $ relationsCache = array ( ) ; if ( is_null ( $ respondentId ) ) { $ respondentId = $ this -> loader -> getUtil ( ) -> getDbLookup ( ) -> getRespondentId ( $ patientNr , $ organizationId ) ; } if ( ! array_key_exists ( $ respondentId , $ relationsCache ) ) { $ relations = array ( ) ; $ filter = array ( 'grr_id_respondent' => $ respondentId ) ; if ( $ onlyActive ) { $ filter [ 'grr_active' ] = 1 ; } $ rawRelations = $ this -> load ( $ filter ) ; foreach ( $ rawRelations as $ relation ) { $ relations [ $ relation [ 'grr_id' ] ] = join ( ' ' , array ( $ relation [ 'grr_type' ] , $ relation [ 'grr_first_name' ] , $ relation [ 'grr_last_name' ] ) ) ; } $ relationsCache [ $ respondentId ] = $ relations ; } return $ relationsCache [ $ respondentId ] ; }
|
Get the relations for a given respondentId or patientNr + organizationId combination
|
57,562
|
public static function getLogger ( ) { if ( ! self :: $ _logger ) { if ( $ zfdebug = Zend_Controller_Front :: getInstance ( ) -> getPlugin ( 'ZFDebug_Controller_Plugin_Debug' ) ) { self :: $ _logger = $ zfdebug -> getPlugin ( 'Log' ) -> getLog ( ) ; } else { return false ; } } return self :: $ _logger ; }
|
Get the ZFDebug logger
|
57,563
|
public static function errorHandler ( $ level , $ message , $ file , $ line ) { if ( ! ( $ level & error_reporting ( ) ) ) return false ; switch ( $ level ) { case E_NOTICE : case E_USER_NOTICE : $ method = 'notice' ; $ type = 'Notice' ; break ; case E_WARNING : case E_USER_WARNING : $ method = 'warn' ; $ type = 'Warning' ; break ; case E_ERROR : case E_USER_ERROR : $ method = 'crit' ; $ type = 'Fatal Error' ; break ; default : $ method = 'err' ; $ type = 'Unknown, ' . $ level ; break ; } self :: $ errors [ ] = array ( 'type' => $ type , 'message' => $ message , 'file' => $ file , 'line' => $ line , 'trace' => debug_backtrace ( ) ) ; $ message = sprintf ( "%s in %s on line %d" , $ message , str_replace ( $ _SERVER [ 'DOCUMENT_ROOT' ] , '' , $ file ) , $ line ) ; if ( ( $ logger = self :: getLogger ( ) ) ) { $ logger -> $ method ( $ message ) ; } return false ; }
|
Debug Bar php error handler
|
57,564
|
public function loadExtra ( $ name ) { $ useCurrent = ZenValidator :: config ( ) -> use_current ; $ parsleyFolder = 'parsley' ; if ( $ useCurrent ) { $ parsleyFolder = 'parsley_current' ; } Requirements :: javascript ( ZENVALIDATOR_PATH . '/javascript/' . $ parsleyFolder . '/extra/validator/' . $ name . '.js' ) ; $ lang = i18n :: get_lang_from_locale ( i18n :: get_locale ( ) ) ; Requirements :: javascript ( ZENVALIDATOR_PATH . '/javascript/' . $ parsleyFolder . '/i18n/' . $ lang . '.extra.js' ) ; }
|
Load extra validator
|
57,565
|
public function validate ( $ value ) { if ( isset ( $ value [ 'Files' ] ) ) { foreach ( $ value [ 'Files' ] as $ fileID ) { $ file = File :: get ( ) -> byId ( $ fileID ) ; if ( $ file -> ClassName == 'Image' ) { $ info = getimagesize ( BASE_PATH . "/" . $ file -> Filename ) ; if ( $ info && is_array ( $ info ) ) { $ width = $ info [ 0 ] ; $ height = $ info [ 1 ] ; switch ( $ this -> type ) { case self :: WIDTH : return $ width == $ this -> val1 ; break ; case self :: HEIGHT : return $ height == $ this -> val1 ; break ; case self :: WIDTH_HEIGHT : return ( ( $ width == $ this -> val1 ) && ( $ height == $ this -> val2 ) ) ; break ; case self :: RATIO : $ baseWidth = floor ( $ width / $ this -> val1 ) ; $ baseHeight = floor ( $ height / $ this -> val2 ) ; return $ baseWidth == $ baseHeight ; break ; case self :: MIN_WIDTH : return $ width >= $ this -> val1 ; break ; case self :: MIN_HEIGHT : return $ height >= $ this -> val1 ; break ; case self :: MIN_WIDTH_HEIGHT : return ( ( $ width >= $ this -> val1 ) && ( $ height >= $ this -> val2 ) ) ; break ; case self :: MAX_WIDTH : return $ width <= $ this -> val1 ; break ; case self :: MAX_HEIGHT : return $ height <= $ this -> val1 ; break ; case self :: MAX_WIDTH_HEIGHT : return ( ( $ width <= $ this -> val1 ) && ( $ height <= $ this -> val2 ) ) ; break ; default : throw new Exception ( 'Invalid type : ' . $ this -> type ) ; } } } } } else { return true ; } }
|
Validate function called for validator .
|
57,566
|
public function getDefaultMessage ( ) { switch ( $ this -> type ) { case self :: WIDTH : return sprintf ( _t ( 'ZenValidator.DIMWIDTH' , 'Image width must be %s pixels' ) , $ this -> val1 ) ; break ; case self :: HEIGHT : return sprintf ( _t ( 'ZenValidator.DIMHEIGHT' , 'Image height must be %s pixels' ) , $ this -> val1 ) ; break ; case self :: WIDTH_HEIGHT : return sprintf ( _t ( 'ZenValidator.DIMWIDTHHEIGHT' , 'Image width must be %s pixels and Image height must be %s pixels' ) , $ this -> val1 , $ this -> val2 ) ; break ; case self :: RATIO : return sprintf ( _t ( 'ZenValidator.DIMRATIO' , 'Image aspect ratio (shape) must be %s:%s' ) , $ this -> val1 , $ this -> val2 ) ; break ; case self :: MIN_WIDTH : return sprintf ( _t ( 'ZenValidator.DIMMINWIDTH' , 'Image width must be greater than or equal to %s pixels' ) , $ this -> val1 ) ; break ; case self :: MIN_HEIGHT : return sprintf ( _t ( 'ZenValidator.DIMMINHEIGHT' , 'Image height must be greater than or equal to %s pixels' ) , $ this -> val1 ) ; break ; case self :: MIN_WIDTH_HEIGHT : return sprintf ( _t ( 'ZenValidator.DIMMINWIDTHHEIGHT' , 'Image width must be greater than or equal to %s pixels and Image height must be greater than or equal to %s pixels' ) , $ this -> val1 , $ this -> val2 ) ; break ; case self :: MAX_WIDTH : return sprintf ( _t ( 'ZenValidator.DIMMAXWIDTH' , 'Image width must be less than or equal to %s pixels' ) , $ this -> val1 ) ; break ; case self :: MAX_HEIGHT : return sprintf ( _t ( 'ZenValidator.DIMMAXHEIGHT' , 'Image height must be less than or equal to %s pixels' ) , $ this -> val1 ) ; break ; case self :: MAX_WIDTH_HEIGHT : return sprintf ( _t ( 'ZenValidator.DIMMAXWIDTHHEIGHT' , 'Image width must be less than or equal to %s pixels and Image height must be less than or equal to %s pixels' ) , $ this -> val1 , $ this -> val2 ) ; break ; } }
|
Gets the default message for the validator
|
57,567
|
protected function addColumns ( \ MUtil_Html_TableElement $ table ) { $ table -> addColumn ( array ( \ MUtil_Html :: raw ( $ this -> repeater -> key ) , 'class' => $ this -> repeater -> class ) , $ this -> _ ( 'Question code' ) ) ; $ table -> addColumn ( array ( \ MUtil_Html :: raw ( $ this -> repeater -> question ) , 'class' => $ this -> repeater -> class ) , $ this -> _ ( 'Question' ) ) ; $ table -> addColumn ( $ this -> repeater -> answers -> call ( $ this , 'showAnswers' , $ this -> repeater -> answers ) , $ this -> _ ( 'Answer options' ) ) ; }
|
Add the columns ot the table
|
57,568
|
protected function addClass ( $ addClass ) { $ targetClass = $ this -> getAttrib ( 'class' ) ; if ( ! empty ( $ targetClass ) && ( strpos ( $ targetClass , $ addClass ) === false ) ) { $ targetClass .= " {$addClass}" ; } else { $ targetClass = $ addClass ; } $ this -> setAttrib ( 'class' , $ targetClass ) ; return $ this ; }
|
Add a class to an existing class taking care of spacing
|
57,569
|
public function setBasePath ( $ basePath ) { $ basePath = ( string ) $ basePath ; if ( file_exists ( $ basePath . '/ckeditor.js' ) ) { $ this -> basePath = $ basePath ; } else { throw new \ Zend_Exception ( sprintf ( 'CKEditor.php not found at %s' , $ basePath ) ) ; } return $ this ; }
|
Set the path to the public files of the CKEditor
|
57,570
|
public function setCKConfig ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { if ( false === $ value ) { $ this -> config = $ key ; } else { foreach ( $ key as $ idx => $ value ) { $ this -> config [ $ idx ] = $ value ; } } } else { $ this -> config [ $ key ] = $ value ; } }
|
Set the configuration for the CKEditor
|
57,571
|
protected function getResultTable ( $ results ) { $ resultSet = 1 ; $ resultTable = \ MUtil_Html :: create ( ) -> array ( ) ; foreach ( $ results as $ result ) { if ( is_string ( $ result ) ) { $ this -> addMessage ( $ result ) ; } else { $ resultRow = $ resultTable -> echo ( $ result , sprintf ( $ this -> _ ( 'Result set %s.' ) , $ resultSet ++ ) ) ; $ resultRow -> class = 'browser' ; } } return $ resultTable ; }
|
Return an array attribute with the current resultset
|
57,572
|
public static function pagePanel ( $ paginator = null , $ request = null , $ translator = null , $ args = null ) { $ types = array ( 'paginator' => 'Zend_Paginator' , 'request' => 'Zend_Controller_Request_Abstract' , 'translator' => 'Zend_Translate' , 'view' => 'Zend_View' , ) ; $ args = \ MUtil_Ra :: args ( func_get_args ( ) , $ types , null , \ MUtil_Ra :: STRICT ) ; $ panel_args = array ( ) ; foreach ( array ( 'baseUrl' , 'paginator' , 'request' , 'scrollingStyle' , 'view' , 'itemCount' ) as $ var ) { if ( isset ( $ args [ $ var ] ) ) { $ panel_args [ $ var ] = $ args [ $ var ] ; unset ( $ args [ $ var ] ) ; } } if ( isset ( $ args [ 'translator' ] ) ) { $ translator = $ args [ 'translator' ] ; unset ( $ args [ 'translator' ] ) ; } else { $ translator = \ Zend_Registry :: get ( 'Zend_Translate' ) ; } if ( isset ( $ args [ 'class' ] ) ) { if ( $ args [ 'class' ] instanceof \ MUtil_Html_AttributeInterface ) { $ args [ 'class' ] -> add ( 'browselink' ) ; } else { $ args [ 'class' ] = new \ MUtil_Html_ClassArrayAttribute ( 'browselink' , $ args [ 'class' ] ) ; ; } } else { $ args [ 'class' ] = new \ MUtil_Html_ClassArrayAttribute ( 'browselink' ) ; } if ( \ MUtil_Bootstrap :: enabled ( ) ) { $ pager = new \ MUtil_Bootstrap_Html_PagePanel ( $ panel_args ) ; } else { $ pager = new \ MUtil_Html_PagePanel ( $ panel_args ) ; } $ pager [ ] = $ pager -> pageLinks ( array ( $ translator -> _ ( '<< First' ) , 'class' => new \ MUtil_Html_ClassArrayAttribute ( 'browselink' , 'keyHome' ) ) , array ( $ translator -> _ ( '< Previous' ) , 'class' => new \ MUtil_Html_ClassArrayAttribute ( 'browselink' , 'keyPgUp' ) ) , array ( $ translator -> _ ( 'Next >' ) , 'class' => new \ MUtil_Html_ClassArrayAttribute ( 'browselink' , 'keyPgDn' ) ) , array ( $ translator -> _ ( 'Last >>' ) , 'class' => new \ MUtil_Html_ClassArrayAttribute ( 'browselink' , 'keyEnd' ) ) , $ translator -> _ ( ' | ' ) , $ args ) ; $ pager -> div ( $ pager -> uptoOffDynamic ( $ translator -> _ ( 'to' ) , $ translator -> _ ( 'of' ) , array ( '-' , 'class' => new \ MUtil_Html_ClassArrayAttribute ( 'browselink btn btn-xs' , 'keyCtrlUp' ) ) , array ( '+' , 'class' => new \ MUtil_Html_ClassArrayAttribute ( 'browselink btn btn-xs' , 'keyCtrlDown' ) ) , null , ' ' , $ args ) , array ( 'class' => 'pagination-index rightFloat pull-right' ) ) ; return $ pager ; }
|
Create a page panel
|
57,573
|
public function _processRowAfterLoad ( array $ row , $ new = false , $ isPost = false , & $ transformColumns = array ( ) ) { if ( $ this -> _addLoadDependency ) { if ( ! ( isset ( $ row [ 'gtf_field_type' ] ) && $ row [ 'gtf_field_type' ] ) ) { $ row [ 'gtf_field_type' ] = $ this -> getFieldType ( $ row ) ; } if ( ! isset ( $ row [ $ this -> _modelField ] ) ) { $ row [ $ this -> _modelField ] = $ this -> getModelNameForRow ( $ row ) ; } $ class = $ this -> getTypeDependencyClass ( $ row [ 'gtf_field_type' ] ) ; if ( $ class ) { $ dependency = $ this -> tracker -> createTrackClass ( $ class , $ row [ 'gtf_id_track' ] ) ; $ this -> addDependency ( $ dependency , null , null , 'row' ) ; } } return parent :: _processRowAfterLoad ( $ row , $ new , $ isPost , $ transformColumns ) ; }
|
Process on load functions and dependencies
|
57,574
|
protected function addAppointmentsToModel ( ) { $ model = new \ MUtil_Model_TableModel ( 'gems__track_appointments' ) ; \ Gems_Model :: setChangeFieldsByPrefix ( $ model , 'gtap' ) ; $ map = $ model -> getItemsOrdered ( ) ; $ map = array_combine ( $ map , str_replace ( 'gtap_' , 'gtf_' , $ map ) ) ; $ map [ 'gtap_id_app_field' ] = 'gtf_id_field' ; $ this -> addUnionModel ( $ model , $ map , self :: APPOINTMENTS_NAME ) ; $ model -> addColumn ( new \ Zend_Db_Expr ( "'appointment'" ) , 'gtf_field_type' ) ; $ model -> addColumn ( new \ Zend_Db_Expr ( "NULL" ) , 'gtf_field_values' ) ; $ model -> addColumn ( new \ Zend_Db_Expr ( "NULL" ) , 'gtf_field_default' ) ; $ model -> addColumn ( new \ Zend_Db_Expr ( "NULL" ) , 'gtf_calculate_using' ) ; }
|
Add appointment model to union model
|
57,575
|
protected function getFieldType ( array & $ row ) { if ( isset ( $ row [ $ this -> _modelField ] ) && ( $ row [ $ this -> _modelField ] === self :: APPOINTMENTS_NAME ) ) { return 'appointment' ; } if ( isset ( $ row [ 'gtf_id_field' ] ) && $ row [ 'gtf_id_field' ] ) { $ row [ \ Gems_Model :: FIELD_ID ] = $ row [ 'gtf_id_field' ] ; } if ( isset ( $ row [ \ Gems_Model :: FIELD_ID ] ) ) { return $ this -> db -> fetchOne ( "SELECT gtf_field_type FROM gems__track_fields WHERE gtf_id_field = ?" , $ row [ \ Gems_Model :: FIELD_ID ] ) ; } if ( ! $ this -> has ( 'gtf_field_type' , 'default' ) ) { $ this -> set ( 'gtf_field_type' , 'default' , 'text' ) ; } return $ this -> get ( 'gtf_field_type' , 'default' ) ; }
|
Get the type from the row in case it was not set
|
57,576
|
public function getFieldTypes ( ) { $ output = array ( 'activity' => $ this -> _ ( 'Activity' ) , 'appointment' => $ this -> _ ( 'Appointment' ) , 'boolean' => $ this -> _ ( 'Boolean' ) , 'caretaker' => $ this -> _ ( 'Caretaker' ) , 'consent' => $ this -> _ ( 'Consent' ) , 'date' => $ this -> _ ( 'Date' ) , 'text' => $ this -> _ ( 'Free text' ) , 'textarea' => $ this -> _ ( 'Long free text' ) , 'location' => $ this -> _ ( 'Location' ) , 'datetime' => $ this -> _ ( 'Moment in time' ) , 'procedure' => $ this -> _ ( 'Procedure' ) , 'relation' => $ this -> _ ( 'Relation' ) , 'select' => $ this -> _ ( 'Select one' ) , 'multiselect' => $ this -> _ ( 'Select multiple' ) , 'track' => $ this -> _ ( 'Track' ) , ) ; asort ( $ output ) ; return $ output ; }
|
The list of field types
|
57,577
|
public function getModelNameForRow ( array $ row ) { if ( isset ( $ row [ 'gtf_field_type' ] ) && ( 'appointment' === $ row [ 'gtf_field_type' ] ) ) { return self :: APPOINTMENTS_NAME ; } if ( ( ! isset ( $ row [ 'gtf_field_type' ] ) ) && isset ( $ row [ $ this -> _modelField ] ) && $ row [ $ this -> _modelField ] ) { return $ row [ $ this -> _modelField ] ; } return self :: FIELDS_NAME ; }
|
Get the name of the union model that should be used for this row .
|
57,578
|
public function loadFirst ( $ filter = true , $ sort = true , $ loadDependencies = true ) { $ oldDep = $ this -> _addLoadDependency ; $ this -> _addLoadDependency = $ loadDependencies ; $ output = parent :: loadFirst ( $ filter , $ sort ) ; $ this -> _addLoadDependency = $ oldDep ; return $ output ; }
|
Returns an array containing the first requested item .
|
57,579
|
public function getDeleteQuestion ( ) { $ field = $ this -> _getParam ( 'fid' ) ; if ( FieldMaintenanceModel :: APPOINTMENTS_NAME === $ this -> _getParam ( 'sub' ) ) { $ used = $ this -> db -> fetchOne ( "SELECT COUNT(*) FROM gems__respondent2track2appointment WHERE gr2t2a_id_app_field = ? AND gr2t2a_id_appointment IS NOT NULL" , $ field ) ; } else { $ used = $ this -> db -> fetchOne ( "SELECT COUNT(*) FROM gems__respondent2track2field WHERE gr2t2f_id_field = ? AND gr2t2f_value IS NOT NULL" , $ field ) ; } if ( ! $ used ) { return $ this -> _ ( 'Do you want to delete this field?' ) ; } $ this -> addMessage ( sprintf ( $ this -> plural ( 'This field will be deleted from %s assigned track.' , 'This field will be deleted from %s assigned tracks.' , $ used ) , $ used ) ) ; return sprintf ( $ this -> plural ( 'Do you want to delete this field and the value stored for the field?' , 'Do you want to delete this field and the %s values stored for the field?' , $ used ) , $ used ) ; }
|
Helper function to get the question for the delete action .
|
57,580
|
public function getCreateTitle ( ) { return sprintf ( $ this -> _ ( 'New field for %s track...' ) , $ this -> util -> getTrackData ( ) -> getTrackTitle ( $ this -> _getIdParam ( ) ) ) ; }
|
Helper function to get the title for the create action .
|
57,581
|
public function formatString ( $ input ) { if ( is_array ( $ input ) ) { $ input = join ( ', ' , $ input ) ; } $ output = strip_tags ( $ input ) ; $ output = str_replace ( array ( "\r" , "\n" ) , array ( ' ' , ' ' ) , $ output ) ; $ output = $ this -> filterCsvInjection ( $ output ) ; return $ output ; }
|
Formatting of strings for CSV export .
|
57,582
|
public function addSeparator ( $ token ) { $ this -> wikiContent .= $ this -> wikiContentArr [ $ this -> separatorCount ] ; ++ $ this -> separatorCount ; if ( $ this -> separatorCount > count ( $ this -> separators ) ) { $ this -> currentSeparator = end ( $ this -> separators ) ; } else { $ this -> currentSeparator = $ this -> separators [ $ this -> separatorCount - 1 ] ; } $ this -> wikiContent .= $ this -> currentSeparator ; $ this -> contents [ $ this -> separatorCount ] = '' ; $ this -> wikiContentArr [ $ this -> separatorCount ] = '' ; }
|
Called by the inline parser when it found a separator .
|
57,583
|
public function getWikiContent ( ) { return $ this -> beginTag . $ this -> wikiContent . $ this -> wikiContentArr [ $ this -> separatorCount ] . $ this -> endTag ; }
|
Returns the wiki content of the tag .
|
57,584
|
public function getContent ( ) { $ cntattr = count ( $ this -> attribute ) ; $ count = ( $ this -> separatorCount >= $ cntattr ) ? ( $ cntattr - 1 ) : $ this -> separatorCount ; for ( $ i = 0 ; $ i <= $ count ; ++ $ i ) { if ( $ this -> attribute [ $ i ] != '$$' ) { $ this -> generator -> setAttribute ( $ this -> attribute [ $ i ] , $ this -> wikiContentArr [ $ i ] ) ; } } return $ this -> generator ; }
|
Return generators that will generate final content .
|
57,585
|
public function isOtherTagAllowed ( ) { if ( isset ( $ this -> attribute [ $ this -> separatorCount ] ) ) { return ( $ this -> attribute [ $ this -> separatorCount ] == '$$' ) ; } else { return false ; } }
|
indicates if the tag can contains other tags .
|
57,586
|
protected function _addRelation ( $ select ) { if ( ! is_null ( $ this -> _gemsData [ 'gto_id_relation' ] ) ) { $ select -> forWhere ( 'gto_id_relation = ?' , $ this -> _gemsData [ 'gto_id_relation' ] ) ; } else { $ select -> forWhere ( 'gto_id_relation IS NULL' ) ; } }
|
Add relation to the select statement
|
57,587
|
protected function _getResultFieldLength ( ) { if ( null !== $ this -> resultFieldLength ) { return $ this -> resultFieldLength ; } if ( null !== self :: $ staticResultFieldLength ) { $ this -> resultFieldLength = self :: $ staticResultFieldLength ; return $ this -> resultFieldLength ; } $ model = new \ MUtil_Model_TableModel ( 'gems__tokens' ) ; self :: $ staticResultFieldLength = $ model -> get ( 'gto_result' , 'maxlength' ) ; $ this -> resultFieldLength = self :: $ staticResultFieldLength ; return $ this -> resultFieldLength ; }
|
The maximum length of the result field
|
57,588
|
protected function _updateToken ( array $ values , $ userId ) { if ( $ this -> tracker -> filterChangesOnly ( $ this -> _gemsData , $ values ) ) { if ( \ Gems_Tracker :: $ verbose ) { $ echo = '' ; foreach ( $ values as $ key => $ val ) { $ echo .= $ key . ': ' . $ this -> _gemsData [ $ key ] . ' => ' . $ val . "\n" ; } \ MUtil_Echo :: r ( $ echo , 'Updated values for ' . $ this -> _tokenId ) ; } if ( ! isset ( $ values [ 'gto_changed' ] ) ) { $ values [ 'gto_changed' ] = new \ MUtil_Db_Expr_CurrentTimestamp ( ) ; } if ( ! isset ( $ values [ 'gto_changed_by' ] ) ) { $ values [ 'gto_changed_by' ] = $ userId ; } $ this -> _gemsData = $ values + ( array ) $ this -> _gemsData ; return $ this -> db -> update ( 'gems__tokens' , $ values , array ( 'gto_id_token = ?' => $ this -> _tokenId ) ) ; } else { return 0 ; } }
|
Update the token both in the database and in memory .
|
57,589
|
public function assignTo ( $ respondentRelationId , $ relationFieldId ) { if ( $ this -> getRelationFieldId ( ) == $ relationFieldId && $ this -> getRelationId ( ) == $ respondentRelationId ) return 0 ; return $ this -> _updateToken ( array ( 'gto_id_relation' => $ respondentRelationId , 'gto_id_relationfield' => $ relationFieldId ) , $ this -> loader -> getCurrentUser ( ) -> getUserId ( ) ) ; }
|
Assign this token to a specific relation
|
57,590
|
public function cacheReset ( $ key = null ) { if ( is_null ( $ key ) ) { $ this -> _cache = array ( ) ; } else { unset ( $ this -> _cache [ $ key ] ) ; } }
|
Reset the local cache for this token
|
57,591
|
protected function calculateReturnUrl ( ) { $ currentUri = $ this -> util -> getCurrentURI ( ) ; $ surveyReturn = $ this -> currentUser -> getSurveyReturn ( ) ; if ( $ surveyReturn ) { $ surveyReturn [ 'NoBase' ] = true ; $ surveyReturn [ 'RouteReset' ] = true ; return $ currentUri . \ MUtil_Html :: urlString ( $ surveyReturn ) ; } return $ currentUri . '/ask/forward/' . \ MUtil_Model :: REQUEST_ID . '/' . urlencode ( $ this -> getTokenId ( ) ) ; }
|
Returns the full url Gems should forward to after survey completion .
|
57,592
|
public function createReplacement ( $ newComment , $ userId , array $ otherValues = array ( ) ) { $ values [ 'gto_id_respondent_track' ] = $ this -> _gemsData [ 'gto_id_respondent_track' ] ; $ values [ 'gto_id_round' ] = $ this -> _gemsData [ 'gto_id_round' ] ; $ values [ 'gto_id_respondent' ] = $ this -> _gemsData [ 'gto_id_respondent' ] ; $ values [ 'gto_id_organization' ] = $ this -> _gemsData [ 'gto_id_organization' ] ; $ values [ 'gto_id_track' ] = $ this -> _gemsData [ 'gto_id_track' ] ; $ values [ 'gto_id_survey' ] = $ this -> _gemsData [ 'gto_id_survey' ] ; $ values [ 'gto_round_order' ] = $ this -> _gemsData [ 'gto_round_order' ] ; $ values [ 'gto_round_description' ] = $ this -> _gemsData [ 'gto_round_description' ] ; $ values [ 'gto_valid_from' ] = $ this -> _gemsData [ 'gto_valid_from' ] ; $ values [ 'gto_valid_from_manual' ] = $ this -> _gemsData [ 'gto_valid_from_manual' ] ; $ values [ 'gto_valid_until' ] = $ this -> _gemsData [ 'gto_valid_until' ] ; $ values [ 'gto_valid_until_manual' ] = $ this -> _gemsData [ 'gto_valid_until_manual' ] ; $ values [ 'gto_mail_sent_date' ] = $ this -> _gemsData [ 'gto_mail_sent_date' ] ; $ values [ 'gto_comment' ] = $ newComment ; $ newValues = $ otherValues + $ values ; foreach ( $ newValues as & $ value ) { if ( $ value instanceof \ Zend_Date ) { $ value = $ value -> getIso ( ) ; } } $ tokenId = $ this -> tracker -> createToken ( $ newValues , $ userId ) ; $ replacementLog [ 'gtrp_id_token_new' ] = $ tokenId ; $ replacementLog [ 'gtrp_id_token_old' ] = $ this -> _tokenId ; $ replacementLog [ 'gtrp_created' ] = new \ MUtil_Db_Expr_CurrentTimestamp ( ) ; $ replacementLog [ 'gtrp_created_by' ] = $ userId ; $ this -> db -> insert ( 'gems__token_replacements' , $ replacementLog ) ; return $ tokenId ; }
|
Creates an almost exact copy of this token at the same place in the track only without answers and other source data
|
57,593
|
public function getAllUnansweredTokens ( $ where = '' ) { $ select = $ this -> tracker -> getTokenSelect ( ) ; $ select -> andReceptionCodes ( ) -> andRespondentTracks ( ) -> andRounds ( array ( ) ) -> andSurveys ( array ( ) ) -> andTracks ( ) -> forGroupId ( $ this -> getSurvey ( ) -> getGroupId ( ) ) -> forRespondent ( $ this -> getRespondentId ( ) , $ this -> getOrganizationId ( ) ) -> onlySucces ( ) -> forWhere ( 'gsu_active = 1' ) -> forWhere ( 'gro_active = 1 OR gro_active IS NULL' ) -> order ( 'gtr_track_name' ) -> order ( 'gr2t_track_info' ) -> order ( 'gto_valid_until' ) -> order ( 'gto_valid_from' ) ; $ this -> _addRelation ( $ select ) ; if ( ! empty ( $ where ) ) { $ select -> forWhere ( $ where ) ; } return $ select -> fetchAll ( ) ; }
|
Get all unanswered tokens for the person answering this token
|
57,594
|
public function getAnswerSnippetNames ( ) { if ( $ this -> exists ) { if ( ! $ this -> _loopCheck ) { $ this -> _loopCheck = true ; $ snippets = $ this -> getTrackEngine ( ) -> getRoundAnswerSnippets ( $ this ) ; if ( ! $ snippets ) { $ snippets = $ this -> getSurvey ( ) -> getAnswerSnippetNames ( $ this ) ; } if ( $ snippets ) { $ this -> _loopCheck = false ; return $ snippets ; } } return $ this -> getTrackEngine ( ) -> getAnswerSnippetNames ( ) ; } else { return 'Token\\TokenNotFoundSnippet' ; } }
|
Returns a snippet name that can be used to display the answers to this token .
|
57,595
|
public function getCopiedFrom ( ) { if ( null === $ this -> _copiedFromTokenId ) { $ this -> _copiedFromTokenId = $ this -> db -> fetchOne ( "SELECT gtrp_id_token_old FROM gems__token_replacements WHERE gtrp_id_token_new = ?" , $ this -> _tokenId ) ; } return $ this -> _copiedFromTokenId ; }
|
Get the token id of the token this one was copied from null when not loaded false when does not exist
|
57,596
|
public function getEmail ( ) { if ( $ this -> getSurvey ( ) -> isTakenByStaff ( ) ) { return null ; } if ( $ this -> hasRelation ( ) ) { if ( $ relation = $ this -> getRelation ( ) ) { return $ relation -> getEmail ( ) ; } return null ; } return $ this -> getRespondent ( ) -> getEmailAddress ( ) ; }
|
Get the email address of the person who needs to fill out this survey .
|
57,597
|
public function getNextToken ( ) { if ( null === $ this -> _nextToken ) { $ tokenSelect = $ this -> tracker -> getTokenSelect ( ) ; $ tokenSelect -> andReceptionCodes ( ) -> forPreviousTokenId ( $ this -> _tokenId ) ; if ( $ tokenData = $ tokenSelect -> fetchRow ( ) ) { $ this -> _nextToken = $ this -> tracker -> getToken ( $ tokenData ) ; $ this -> _nextToken -> _previousToken = $ this ; } else { $ this -> _nextToken = false ; } } return $ this -> _nextToken ; }
|
Returns the next token in this track
|
57,598
|
public function getNextUnansweredToken ( ) { $ tokenSelect = $ this -> tracker -> getTokenSelect ( ) ; $ tokenSelect -> andReceptionCodes ( ) -> andRounds ( array ( ) ) -> andSurveys ( array ( ) ) -> forRespondent ( $ this -> getRespondentId ( ) ) -> forGroupId ( $ this -> getSurvey ( ) -> getGroupId ( ) ) -> onlySucces ( ) -> onlyValid ( ) -> forWhere ( 'gsu_active = 1' ) -> forWhere ( 'gro_active = 1 OR gro_active IS NULL' ) -> order ( array ( 'gto_valid_from' , 'gto_round_order' ) ) ; $ this -> _addRelation ( $ tokenSelect ) ; if ( $ tokenData = $ tokenSelect -> fetchRow ( ) ) { return $ this -> tracker -> getToken ( $ tokenData ) ; } }
|
Returns the next unanswered token for the person answering this token
|
57,599
|
public function getPreviousSuccessToken ( ) { $ prev = $ this -> getPreviousToken ( ) ; while ( $ prev && ( ! $ prev -> hasSuccesCode ( ) ) ) { $ prev = $ prev -> getPreviousToken ( ) ; } return $ prev ; }
|
Returns the previous token that has succes in this track
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.