-
Notifications
You must be signed in to change notification settings - Fork 986
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
267 additions
and
0 deletions.
There are no files selected for viewing
112 changes: 112 additions & 0 deletions
112
application/views/admin/emailtemplates/email_language_tab.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?php | ||
$tabs = array( | ||
'invitation' => array( | ||
'title' => $clang->gT("Invitation"), | ||
'subject' => $clang->gT("Invitation email subject:"), | ||
'body' => $clang->gT("Invitation email body:"), | ||
'attachments' => $clang->gT("Invitation attachments:"), | ||
'field' => array( | ||
'subject' => 'surveyls_email_invite_subj', | ||
'body' => 'surveyls_email_invite' | ||
), | ||
'default' => array( | ||
'subject' => $aDefaultTexts['invitation_subject'], | ||
'body' => $aDefaultTexts['invitation'] | ||
) | ||
), | ||
'reminder' => array( | ||
'title' => $clang->gT("Reminder"), | ||
'subject' => $clang->gT("Reminder email subject:"), | ||
'body' => $clang->gT("Reminder email body:"), | ||
'attachments' => $clang->gT("Reminder attachments:"), | ||
'field' => array( | ||
'subject' => 'surveyls_email_remind_subj', | ||
'body' => 'surveyls_email_remind' | ||
), | ||
'default' => array( | ||
'subject' => $aDefaultTexts['reminder_subject'], | ||
'body' => $aDefaultTexts['reminder'] | ||
) | ||
), | ||
'confirmation' => array( | ||
'title' => $clang->gT("Confirmation"), | ||
'subject' => $clang->gT("Confirmation email subject:"), | ||
'body' => $clang->gT("Confirmation email body:"), | ||
'attachments' => $clang->gT("Confirmation attachments:"), | ||
'field' => array( | ||
'subject' => 'surveyls_email_confirm_subj', | ||
'body' => 'surveyls_email_confirm' | ||
), | ||
'default' => array( | ||
'subject' => $aDefaultTexts['confirmation_subject'], | ||
'body' => $aDefaultTexts['confirmation'] | ||
) | ||
), | ||
'registration' => array( | ||
'title' => $clang->gT("Registration"), | ||
'subject' => $clang->gT("Registration email subject:"), | ||
'body' => $clang->gT("Registration email body:"), | ||
'attachments' => $clang->gT("Registration attachments:"), | ||
'field' => array( | ||
'subject' => 'surveyls_email_register_subj', | ||
'body' => 'surveyls_email_register' | ||
), | ||
'default' => array( | ||
'subject' => $aDefaultTexts['registration_subject'], | ||
'body' => $aDefaultTexts['registration'] | ||
) | ||
), | ||
'admin_notification' => array( | ||
'title' => $clang->gT("Basic admin notification"), | ||
'subject' => $clang->gT("Basic admin notification subject:"), | ||
'body' => $clang->gT("Basic admin notification email body:"), | ||
'attachments' => $clang->gT("Basic notification attachments:"), | ||
'field' => array( | ||
'subject' => 'email_admin_notification_subj', | ||
'body' => 'email_admin_notification' | ||
), | ||
'default' => array( | ||
'subject' => $aDefaultTexts['admin_notification_subject'], | ||
'body' => $aDefaultTexts['admin_notification'] | ||
) | ||
), | ||
'admin_detailed_notification' => array( | ||
'title' => $clang->gT("Detailed admin notification"), | ||
'subject' => $clang->gT("Detailed admin notification subject:"), | ||
'body' => $clang->gT("Detailed admin notification email body:"), | ||
'attachments' => $clang->gT("Detailed notification attachments:"), | ||
'field' => array( | ||
'subject' => 'email_admin_responses_subj', | ||
'body' => 'email_admin_responses' | ||
), | ||
'default' => array( | ||
'subject' => $aDefaultTexts['admin_detailed_notification_subject'], | ||
'body' => $aDefaultTexts['admin_detailed_notification'] | ||
) | ||
) | ||
); | ||
|
||
|
||
echo "<div id='tab-$grouplang'>"; | ||
echo "<div class='tabsinner' id='tabsinner-$grouplang'>"; | ||
?> | ||
|
||
|
||
|
||
<ul> | ||
<?php | ||
foreach ($tabs as $tab => $details) | ||
{ | ||
echo "<li><a href='#tab-$grouplang-$tab'>{$details['title']}</a></li>"; | ||
} | ||
?> | ||
</ul> | ||
|
||
<?php | ||
foreach ($tabs as $tab => $details) | ||
{ | ||
$this->renderPartial('/admin/emailtemplates/email_language_template_tab', compact('ishtml', 'surveyid' , 'esrow', 'grouplang', 'tab', 'details', 'clang')); | ||
} | ||
?> | ||
</div> | ||
</div> |
66 changes: 66 additions & 0 deletions
66
application/views/admin/emailtemplates/email_language_template_tab.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
<div id='<?php echo "tab-$grouplang-$tab"; ?>'> | ||
<ul> | ||
<li> | ||
<label for='email_<?php echo $tab; ?>_subj_<?php echo $grouplang; ?>'><?php echo $details['subject'] ?></label> | ||
|
||
<input type='text' size='80' name='<?php echo "email_{$tab}_subj_$grouplang"; ?>' id='<?php echo "email_{$tab}_subj_{$grouplang}"; ?>' value="<?php echo $esrow->{$details['field']['subject']}; ?>" /> | ||
|
||
<input | ||
type='button' | ||
value='<?php $clang->eT("Use default"); ?>' | ||
class="fillin" | ||
data-target="<?php echo "email_{$tab}_subj_{$grouplang}"; ?>" | ||
data-value="<?php echo $details['default']['subject']; ?>" | ||
/> | ||
</li> | ||
<li><label for='email_<?php echo $tab; ?>_<?php echo $grouplang; ?>'><?php echo $details['body']; ?></label> | ||
<textarea cols='80' rows='20' name='email_<?php echo $tab; ?>_<?php echo $grouplang; ?>' id='<?php echo "email_{$tab}_{$grouplang}"; ?>'><?php echo htmlspecialchars($esrow->{$details['field']['body']}); ?></textarea> | ||
<?php | ||
echo getEditor("email-$tab","email_{$tab}_$grouplang", "",$surveyid,'','','editemailtemplates'); | ||
?> | ||
<input | ||
type='button' | ||
value='<?php $clang->eT("Use default"); ?>' | ||
class="fillin" | ||
data-target="<?php echo "email_{$tab}_{$grouplang}"; ?>" | ||
data-value="<?php echo htmlspecialchars(conditionalNewlineToBreak($details['default']['body'],$ishtml),ENT_QUOTES); ?>" | ||
/> | ||
</li> | ||
<li> | ||
<label for="attachments_<?php echo "{$grouplang}-{$tab}"; ?>"><?php echo $details['attachments']; ?></label> | ||
<div style="float: left; width: 60%;"> | ||
<button class="add-attachment" id="add-attachment-<?php echo "{$grouplang}-{$tab}"; ?>">Add file</button> | ||
|
||
<table data-template="[<?php echo $grouplang; ?>][<?php echo $tab ?>]" id ="attachments-<?php echo $grouplang; ?>-<?php echo $tab ?>" class="attachments" style="width: 500px"> | ||
<tr> | ||
<th>Action</th> | ||
<th>Filename</th> | ||
<th>Size</th> | ||
<th>Relevance</th> | ||
</tr> | ||
<?php | ||
|
||
if (isset($esrow->attachments[$tab])) | ||
{ | ||
$script = array(); | ||
foreach ($esrow->attachments[$tab] as $attachment) | ||
{ | ||
|
||
$script[] = sprintf("addAttachment($('#attachments-%s-%s'), %s, %s, %s );", $grouplang, $tab, json_encode($attachment['url']), json_encode($attachment['relevance']), json_encode($attachment['size'])); | ||
} | ||
echo '<script type="text/javascript">'; | ||
echo '$(document).ready(function() {'; | ||
echo implode("\n", $script); | ||
echo '});'; | ||
echo '</script>'; | ||
} | ||
?> | ||
</table> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
|
||
|
89 changes: 89 additions & 0 deletions
89
application/views/admin/emailtemplates/emailtemplates_view.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
$surveyinfo = getSurveyInfo($surveyid); | ||
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . 'emailtemplates.js'); | ||
?> | ||
<script type='text/javascript'> | ||
var sReplaceTextConfirmation='<?php $clang->eT("This will replace the existing text. Continue?","js"); ?>'; | ||
|
||
|
||
$(document).ready(function () { | ||
$('button.add-attachment').click(function(e) | ||
{ | ||
e.preventDefault(); | ||
var target = $(this).parent().find('table'); | ||
openKCFinder_singleFile(target); | ||
|
||
}); | ||
|
||
|
||
|
||
}); | ||
|
||
|
||
|
||
|
||
</script> | ||
<style type="text/css"> | ||
|
||
#emailtemplates table.attachments td, #emailtemplates button.add-attachment { | ||
text-align: left; | ||
margin: 2px 2px 2px 2px !important; | ||
|
||
} | ||
|
||
table.attachments td span{ | ||
border: 1px solid #999999; | ||
display:block; | ||
} | ||
|
||
table.attachments img, table.attachments span{ | ||
height: 16px; | ||
cursor: pointer; | ||
} | ||
ul.editor-parent { | ||
overflow: hidden; | ||
} | ||
|
||
|
||
</style> | ||
<div class='header ui-widget-header'> | ||
<?php $clang->eT("Edit email templates"); ?> | ||
</div> | ||
<?php echo CHtml::form(array('admin/emailtemplates/sa/update/surveyid/'.$surveyid), 'post', array('name'=>'emailtemplates', 'class'=>'form30newtabs'));?> | ||
|
||
<div id='tabs'> | ||
<ul> | ||
<?php foreach ($grplangs as $grouplang): ?> | ||
<li><a href='#tab-<?php echo $grouplang; ?>'><?php echo getLanguageNameFromCode($grouplang,false); ?> | ||
<?php if ($grouplang == Survey::model()->findByPk($surveyid)->language): ?> | ||
<?php echo ' ('.$clang->gT("Base language").')'; ?> | ||
<?php endif; ?> | ||
</a></li> | ||
<?php endforeach; ?> | ||
</ul> | ||
<?php | ||
foreach ($grplangs as $key => $grouplang) | ||
{ | ||
$bplang = $bplangs[$key]; | ||
$esrow = $attrib[$key]; | ||
$aDefaultTexts = $defaulttexts[$key]; | ||
if ($ishtml == true) | ||
{ | ||
$aDefaultTexts['admin_detailed_notification']=$aDefaultTexts['admin_detailed_notification_css'].conditionalNewlineToBreak($aDefaultTexts['admin_detailed_notification'],$ishtml); | ||
} | ||
$this->renderPartial('/admin/emailtemplates/email_language_tab', compact('surveyinfo', 'ishtml', 'surveyid', 'clang', 'grouplang', 'bplang', 'esrow', 'aDefaultTexts')); | ||
} | ||
?> | ||
</div> | ||
<p> | ||
<input type='submit' class='standardbtn' value='<?php $clang->eT("Save"); ?>' /> | ||
<input type='hidden' name='action' value='tokens' /> | ||
<input type='hidden' name='language' value="<?php echo $esrow->surveyls_language; ?>" /> | ||
</p> | ||
</form> | ||
<div id="attachment-relevance-editor" style="display: none; overflow: hidden;"> | ||
<textarea style="resize: none; height: 90%; width: 100%; box-sizing: border-box"> | ||
|
||
</textarea> | ||
<button>Apply</button> | ||
</div> |