Esempio n. 1
0
?>
>
		<?php 
include_once JPATH_COMPONENT . DS . 'helpers' . DS . 'header.php';
?>
		
		<?php 
echo CJFunctions::load_module_position('surveys-results-top');
?>
		
		<h2 class="page-header"><?php 
echo $this->escape($this->item->title);
?>
</h2>
		<div class="survey-message"><?php 
echo CJFunctions::process_html($this->item->endtext, $bbcode, $content);
?>
</div>
		
		<?php 
if ($this->hide_template != 1) {
    ?>
		<div class="well center margin-top-20">
			<a class="btn btn-primary" data-loading-text="<?php 
    echo JText::_('TXT_LOADING');
    ?>
" onclick="jQuery(this).button('loading');" 
				href="<?php 
    echo JRoute::_('index.php?option=' . S_APP_NAME . '&view=survey' . $itemid);
    ?>
">
Esempio n. 2
0
 public function get_text_question($item, $class)
 {
     $html = '<div id="qn-' . $item->id . '" class="question-item clearfix well well-transperant">';
     $html .= '<div class="question-title qtype-' . $item->question_type . '">' . CJFunctions::escape($item->title) . '</div>';
     $html .= '<div class="question-description">' . CJFunctions::process_html($item->description, $this->_bbcode, $this->_content) . '</div>';
     $html .= '<div>' . JText::_('LBL_TOTAL_RESPONSES') . ': <span class="label label-success">' . $item->total_votes . '</span></div>';
     $html .= '<p class="margin-top-20"><a href="#" onclick="document.surveyForm.qid.value=' . $item->id . ';' . 'CjSurveyApi.submitAjaxForm(this, \'#surveyForm\', \'report.getanswers\', \'onBeforeGetTextAnswers\', \'onAfterGetTextAnswers\'); return false">' . JText::_('COM_COMMUNITYSURVEYS_VIEW_RESPONSES') . '</a></p>';
     $html .= '</div>';
     return $html;
 }
Esempio n. 3
0
 private function send_invitations($sid, &$contacts, $remaining = 0)
 {
     if (!empty($contacts)) {
         $app = JFactory::getApplication();
         $user = JFactory::getUser();
         $model = $this->getModel('survey');
         $params = JComponentHelper::getParams(S_APP_NAME);
         $itemid = CJFunctions::get_active_menu_id(true, 'index.php?option=' . S_APP_NAME . '&view=survey');
         $editor = $user->authorise('core.wysiwyg', S_APP_NAME) ? $params->get('default_editor', 'bbcode') : 'none';
         $subject = $app->input->getString('invitation-subject', JText::_('TXT_INVITE_DEFAULT_SUB'));
         $default_body = $editor == 'wysiwyg' ? str_replace("\n", '<br>', JText::_('TXT_INVITE_DEFAULT_BODY')) : JText::_('TXT_INVITE_DEFAULT_BODY');
         $body = CJFunctions::get_clean_var('invitation-body', true, $default_body);
         $body = CJFunctions::process_html($body, $editor == 'bbcode');
         $messageid = $app->input->getInt('messageid', 0);
         $count = count($contacts);
         $keys = $model->create_survey_keys($sid, $count);
         if (!empty($keys) && count($keys) > 0) {
             $emails = array();
             foreach ($keys as $i => $key) {
                 $link = JRoute::_('index.php?option=' . S_APP_NAME . '&view=survey&task=take_survey&key=' . $key . $itemid, false, -1);
                 $link = '<a href="' . $link . '">' . $link . '</a>';
                 $email = new stdClass();
                 $email->name = $contacts[$i]->name;
                 $email->subid = 0;
                 $email->link = $link;
                 $email->email = $contacts[$i]->email;
                 $emails[] = $email;
                 $contacts[$i]->key = $key;
                 $i++;
             }
             $template = $params->get('mail-tpl-newanswer', 'mail-blue.tpl');
             $sent = $model->add_messages_to_queue($sid, $subject, $body, $emails, $template, $messageid);
             $model->update_key_userids($sid, $contacts);
             if ($sent === false) {
                 echo json_encode(array('error' => JText::_('MSG_ERROR_PROCESSING') . (S_DEBUG_ENABLED ? $model->getError() : '')));
             } else {
                 echo json_encode(array('message' => JText::sprintf('MSG_INVITATIONS_ADDED_TO_QUEUE', $sent), 'remaining' => $remaining));
             }
         } else {
             echo json_encode(array('error' => JText::_('MSG_NO_CREDITS')));
         }
     } else {
         echo json_encode(array('error' => JText::_('MSG_NO_CONTACTS_SELECTED')));
     }
 }
Esempio n. 4
0
<div id="cj-wrapper">
	<div<?php 
echo $this->hide_template == 1 ? ' class="full-screen"' : '';
?>
>
		<?php 
include_once JPATH_COMPONENT . DS . 'helpers' . DS . 'header.php';
?>
		
		<h2 class="page-header"><?php 
echo $this->escape($this->item->title);
?>
</h2>
		<div class="custom-pageheader"><?php 
echo CJFunctions::process_html($this->item->custom_header, $bbcode, $content);
?>
</div>
		
		<?php 
if ($this->item->display_progress == 1) {
    ?>
		<div class="margin-bottom-20 margin-top-20">
			<div class="margin-bottom-10" style="text-align: right;"><?php 
    echo JText::sprintf('LBL_PAGE_NO', $this->item->pageno, count($this->item->pages));
    ?>
</div>
			<div class="progress progress-info no-margin-bottom<?php 
    echo $this->item->current == count($this->item->pages) ? '' : ' progress-striped active';
    ?>
">
Esempio n. 5
0
    public function get_address_question($item, $class)
    {
        $free_text = '';
        $country_options = array();
        $classname = $item->mandatory ? ' required' : '';
        $html = '<div id="qn-' . $item->id . '" class="question-item well well-transperant' . (isset($item->hidden) ? ' hideme ' : ' ') . $class . ' ' . $item->params->get('question_class', '') . ' clearfix"' . (isset($item->hidden) ? ' style="display: none;"' : '') . (isset($item->rule_answered) ? ' showitems="' . implode(',', $item->rule_answered) . '"' : '') . '>';
        $html .= '<div class="question-title qtype-' . $item->question_type . ' ' . $item->params->get('title_class', '') . '">' . CJFunctions::escape($item->title) . '</div>';
        $html .= '<div class="question-description ' . $item->params->get('description_class', '') . '">' . CJFunctions::process_html($item->description, $this->_bbcode, $this->_content) . '</div>';
        if (!empty($item->responses)) {
            foreach ($item->responses as $response) {
                if (!empty($response->free_text)) {
                    $free_text = CJFunctions::escape($response->free_text);
                    break;
                }
            }
        }
        $address_parts = explode('|||', $free_text);
        if (count($address_parts) != 7) {
            $address_parts = array('', '', '', '', '', '', '');
        }
        if (null == $this->_countries) {
            $this->_countries = CJFunctions::get_country_names();
        }
        foreach ($this->_countries as $country) {
            $country_options[] = '<option value="' . $country->country_code . '"' . ($address_parts[5] == $country->country_code ? ' selected="selected"' : '') . '>' . CJFunctions::escape($country->country_name) . '</option>';
        }
        $html .= '
		<div class="container-fluid address-wrapper error no-space-left">
			<div class="row-fluid">
				<input type="text" name="address-name-' . $item->id . '" class="span12' . $classname . '" value="' . $address_parts[0] . '" 
					placeholder="' . JText::_('LBL_ADDRESS_FULL_NAME') . '">
			</div>
			<div class="row-fluid">
				<input type="text" name="address-line1-' . $item->id . '" class="span12' . $classname . '" value="' . $address_parts[1] . '" 
					placeholder="' . JText::_('LBL_ADDRESS_ADDRESS_LINE1') . '">
			</div>
			<div class="row-fluid">
				<input type="text" name="address-line2-' . $item->id . '" class="span7" value="' . $address_parts[2] . '" 
					placeholder="' . JText::_('LBL_ADDRESS_ADDRESS_LINE2') . '">
				<input type="text" name="address-city-' . $item->id . '" class="span5' . $classname . ' pull-right" value="' . $address_parts[3] . '" 
					placeholder="' . JText::_('LBL_ADDRESS_ADDRESS_CITY') . '">
			</div>
			<div class="row-fluid">
				<input type="text" name="address-state-' . $item->id . '" class="span4' . $classname . '" value="' . $address_parts[4] . '" 
					placeholder="' . JText::_('LBL_ADDRESS_ADDRESS_STATE') . '">
				<select name="address-country-' . $item->id . '" size="1" class="span5' . $classname . '">
					<option>' . JText::_('LBL_SELECT_OPTION') . '</option>
					' . implode('', $country_options) . '
				</select>
				<input type="text" name="address-zip-' . $item->id . '" class="span3' . $classname . ' pull-right" value="' . $address_parts[6] . '" 
					placeholder="' . JText::_('LBL_ADDRESS_ADDRESS_ZIP') . '">
			</div>
		</div>';
        $html .= '</div>';
        return $html;
    }
Esempio n. 6
0
 public function get_address_question($item, $class, $escape = true)
 {
     $html = '<div id="qn-' . $item->id . '" class="question-item well well-transperant qn-page-header">';
     $html .= '<div class="question-title qtype-' . $item->question_type . '"><i class="fa fa-question-circle"></i> ' . CJFunctions::escape($item->title) . '</div>';
     $html .= '<div class="question-description">' . CJFunctions::process_html($item->description, $this->_bbcode, $this->_content) . '</div>';
     foreach ($item->responses as $response) {
         if (!empty($response->free_text)) {
             $parts = explode('|||', $response->free_text);
             if (count($parts) == 7) {
                 $response->free_text = '<address><strong>' . CJFunctions::escape($parts[0]) . '</strong><br>';
                 $response->free_text .= CJFunctions::escape($parts[1]) . '<br>';
                 if (!empty($parts[2])) {
                     $response->free_text .= CJFunctions::escape($parts[2]) . '<br>';
                 }
                 $response->free_text .= CJFunctions::escape($parts[3]) . ', ' . CJFunctions::escape($parts[4]) . ', ' . CJFunctions::escape($parts[6]) . '<br>';
                 $response->free_text .= CJFunctions::get_country_name(CJFunctions::escape($parts[5]));
             } else {
                 $response->free_text = '';
             }
             $html .= '<h4>' . JText::_('LBL_ANSWER') . '</h4>';
             $html .= '<div>' . $response->free_text . '</div>';
         }
     }
     $html .= '</div>';
     return $html;
 }
Esempio n. 7
0
            case 15:
                echo $formfields->get_calendar_question($question, $class);
                break;
            case 16:
                echo $formfields->get_address_question($question, $class);
                break;
            default:
                break;
        }
    }
    ?>
			<?php 
} else {
    ?>
			<div id="survey-intro"><?php 
    echo CJFunctions::process_html($survey->introtext, $wysiwyg);
    ?>
</div>
			<?php 
    if ($survey->display_notice == '1') {
        ?>
			<div class="well well-small all-caps margin-top-20">
				<?php 
        echo $survey->anonymous == '1' ? JText::_('NOTICE_ANONYMOUS_SURVEY') : JText::_('NOTICE_TRACKED_SURVEY');
        ?>
			</div>
			<?php 
    }
    ?>
			<?php 
}