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);
    }
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);
    }
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.

@return $string
Helper function to get the question for the delete action .