Browse Source

#112 Add email custom field type

Still need to add it to email functions
merge-requests/2/head
Mike Koch 7 years ago
parent
commit
975037c29d
  1. 1
      admin/admin_settings.php
  2. 2
      admin/admin_settings_save.php
  3. 27
      admin/options.php
  4. 5
      language/en/text.php

1
admin/admin_settings.php

@ -1269,6 +1269,7 @@ if ( defined('HESK_DEMO') )
<option value="checkbox" '.($this_field['type'] == 'checkbox' ? 'selected="selected"' : '').'>'.$hesklang['scb'].'</option>
<option value="date" '.($this_field['type'] == 'date' ? 'selected="selected"' : '').'>'.$hesklang['date_custom_field'].'</option>
<option value="multiselect" '.($this_field['type'] == 'multiselect' ? 'selected="selected"' : '').'>'.$hesklang['multiple_select_custom_field'].'</option>
<option value="email" '.($this_field['type'] == 'email' ? 'selected="selected"' : '').'>'.$hesklang['email_custom_field'].'</option>
</select>
</td>
<td><div class="checkbox"><label><input type="checkbox" name="s_custom'.$i.'_req" value="1" id="s_custom'.$i.'_req" '; if ($this_field['req']) {echo 'checked="checked"';} echo $onload_locally.' /> '.$hesklang['yes'].'</label></div></td>

2
admin/admin_settings_save.php

@ -478,7 +478,7 @@ for ($i=1;$i<=20;$i++)
$set['custom_fields'][$this_field]['maxlen'] = intval( hesk_POST('s_custom'.$i.'_maxlen', 255) );
$set['custom_fields'][$this_field]['value'] = hesk_input( hesk_POST('s_custom'.$i.'_val') );
if (!in_array($set['custom_fields'][$this_field]['type'],array('text','textarea','select','radio','checkbox','date','multiselect')))
if (!in_array($set['custom_fields'][$this_field]['type'],array('text','textarea','select','radio','checkbox','date','multiselect','email')))
{
$set['custom_fields'][$this_field]['type'] = 'text';
}

27
admin/options.php

@ -314,6 +314,33 @@ switch ($type)
<p><input type="button" value=" '.$hesklang['ok'].' " onclick="Javascript:hesk_saveOptions()" /></p>
';
break;
case 'email':
$ccSelected = $query == 'cc' ? 'selected="selected"' : '';
$bccSelected = $query == 'bcc' ? 'selected="selected"' : '';
echo '
<script language="javascript">
function hesk_saveOptions()
{
var dropdown = document.getElementById(\'o1\');
window.opener.document.getElementById(\'s_'.$id.'_val\').value = dropdown.options[dropdown.selectedIndex].value;
window.close();
}
</script>
<p>'.$hesklang['email_custom_field_help'].'</p>
<table border="0">
<tr>
<td>'.$hesklang['email_custom_field_label'].':</td>
<td>
<select name="o1" id="o1">
<option value="cc" '.$ccSelected.'>'.$hesklang['cc'].'</option>
<option value="bcc" '.$bccSelected.'>'.$hesklang['bcc'].'</option>
</select>
</td>
</tr>
</table>
<p><input type="button" value=" '.$hesklang['ok'].' " onclick="Javascript:hesk_saveOptions()" /></p>
';
break;
default:
die('Invalid type');
}

5
language/en/text.php

@ -28,6 +28,11 @@ $hesklang['and_change_status_to'] = 'and change status to'; // Used in combinati
$hesklang['closed_title'] = 'Closed';
$hesklang['image'] = 'Image'; // Used for alt tag
$hesklang['close_modal'] = 'Close';
$hesklang['email_custom_field'] = 'Email Address';
$hesklang['email_custom_field_help'] = 'Allows the input of an email address. Similar to a text field, however the email address(es) will be added to all emails for this ticket, in the Cc or Bcc section, depending on the option selected.';
$hesklang['email_custom_field_label'] = 'Address Type';
$hesklang['cc'] = 'Cc:';
$hesklang['bcc'] = 'Bcc:';
// ADDED OR MODIFIED IN Mods For HESK 1.7.0

Loading…
Cancel
Save