Add readonly to manage custom fields
This commit is contained in:
parent
f2774badf1
commit
4c55e50c04
@ -179,8 +179,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
<option value="checkbox" <?php if ($type == 'checkbox') {echo 'selected';} ?> ><?php echo $hesklang['scb']; ?></option>
|
<option value="checkbox" <?php if ($type == 'checkbox') {echo 'selected';} ?> ><?php echo $hesklang['scb']; ?></option>
|
||||||
<option value="date" <?php if ($type == 'date') {echo 'selected';} ?> ><?php echo $hesklang['date']; ?></option>
|
<option value="date" <?php if ($type == 'date') {echo 'selected';} ?> ><?php echo $hesklang['date']; ?></option>
|
||||||
<option value="email" <?php if ($type == 'email') {echo 'selected';} ?> ><?php echo $hesklang['email']; ?></option>
|
<option value="email" <?php if ($type == 'email') {echo 'selected';} ?> ><?php echo $hesklang['email']; ?></option>
|
||||||
|
<option value="readonly" <?php if ($type == 'readonly') {echo 'selected';} ?> ><?php echo $hesklang['readonly_custom_field']; ?></option>
|
||||||
<option value="hidden" <?php if ($type == 'hidden') {echo 'selected';} ?> ><?php echo $hesklang['sch']; ?></option>
|
<option value="hidden" <?php if ($type == 'hidden') {echo 'selected';} ?> ><?php echo $hesklang['sch']; ?></option>
|
||||||
</select>
|
</select><br>
|
||||||
<?php
|
<?php
|
||||||
$value = hesk_SESSION(array('new_cf','value'));
|
$value = hesk_SESSION(array('new_cf','value'));
|
||||||
|
|
||||||
@ -190,7 +191,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="text" style="display:<?php echo ($type == 'text') ? 'block;margin-top:10px' : 'none' ?>">
|
<div id="text" style="display:<?php echo ($type == 'text') ? 'block' : 'none' ?>">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label" for="max_length">
|
<label class="col-sm-3 control-label" for="max_length">
|
||||||
<?php echo $hesklang['custom_l']; ?>
|
<?php echo $hesklang['custom_l']; ?>
|
||||||
@ -211,7 +212,20 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="textarea" style="display:<?php echo ($type == 'textarea') ? 'block;margin-top:10px' : 'none' ?>">
|
|
||||||
|
<div id="readonly" style="display:<?php echo ($type == 'readonly') ? 'block' : 'none' ?>">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label" for="value">
|
||||||
|
<?php echo $hesklang['value']; ?>
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<input type="text" class="form-control" name="value"
|
||||||
|
value="<?php echo isset($value['value']) ? $value['value'] : ''; ?>" size="30">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="textarea" style="display:<?php echo ($type == 'textarea') ? 'block' : 'none' ?>">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label" for="rows">
|
<label class="col-sm-3 control-label" for="rows">
|
||||||
<?php echo $hesklang['rows']; ?>
|
<?php echo $hesklang['rows']; ?>
|
||||||
@ -624,7 +638,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
}
|
}
|
||||||
|
|
||||||
function hesk_setType(myType) {
|
function hesk_setType(myType) {
|
||||||
var divs = ["text", "textarea", "radio", "select", "checkbox", "date", "email", "hidden"];
|
var divs = ["text", "textarea", "radio", "select", "checkbox", "date", "email", "hidden", "readonly"];
|
||||||
var index;
|
var index;
|
||||||
var setTo;
|
var setTo;
|
||||||
|
|
||||||
@ -677,10 +691,6 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$i = 1;
|
|
||||||
$j = 1;
|
|
||||||
$k = 1;
|
|
||||||
|
|
||||||
$before = true;
|
$before = true;
|
||||||
$after = true;
|
$after = true;
|
||||||
$hide_up = false;
|
$hide_up = false;
|
||||||
@ -749,18 +759,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
<i class="fa fa-arrow-down fa-fw icon-link green" data-toggle="tooltip" title="<?php echo $hesklang['move_dn']; ?>"></i>
|
<i class="fa fa-arrow-down fa-fw icon-link green" data-toggle="tooltip" title="<?php echo $hesklang['move_dn']; ?>"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php
|
<?php
|
||||||
}
|
} elseif ($k == $hesk_settings['num_custom_fields'] || $k == $num_before) {
|
||||||
elseif ($k == $hesk_settings['num_custom_fields'] || $k == $num_before)
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<a href="custom_fields.php?a=order_cf&id=<?php echo $id; ?>&move=-15&token=<?php hesk_token_echo(); ?>">
|
<a href="custom_fields.php?a=order_cf&id=<?php echo $id; ?>&move=-15&token=<?php hesk_token_echo(); ?>">
|
||||||
<i class="fa fa-arrow-up fa-fw icon-link green" data-toggle="tooltip" title="<?php echo $hesklang['move_up']; ?>"></i>
|
<i class="fa fa-arrow-up fa-fw icon-link green" data-toggle="tooltip" title="<?php echo $hesklang['move_up']; ?>"></i>
|
||||||
</a>
|
</a>
|
||||||
<i class="fa fa-fw icon-link"> </i>
|
<i class="fa fa-fw icon-link"> </i>
|
||||||
<?php
|
<?php
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<a href="custom_fields.php?a=order_cf&id=<?php echo $id; ?>&move=-15&token=<?php hesk_token_echo(); ?>">
|
<a href="custom_fields.php?a=order_cf&id=<?php echo $id; ?>&move=-15&token=<?php hesk_token_echo(); ?>">
|
||||||
<i class="fa fa-arrow-up fa-fw icon-link green" data-toggle="tooltip" title="<?php echo $hesklang['move_up']; ?>"></i>
|
<i class="fa fa-arrow-up fa-fw icon-link green" data-toggle="tooltip" title="<?php echo $hesklang['move_up']; ?>"></i>
|
||||||
@ -1157,6 +1163,11 @@ function cf_validate()
|
|||||||
$cf['value'] = array('max_length' => $cf['hidden_max_length'], 'default_value' => $cf['hidden_default_value']);
|
$cf['value'] = array('max_length' => $cf['hidden_max_length'], 'default_value' => $cf['hidden_default_value']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'readonly':
|
||||||
|
$value = hesk_POST('value');
|
||||||
|
$cf['value'] = array('value' => $value);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$cf['type'] = 'text';
|
$cf['type'] = 'text';
|
||||||
$cf['max_length'] = hesk_checkMinMax(intval(hesk_POST('max_length')), 1, 10000, 255);
|
$cf['max_length'] = hesk_checkMinMax(intval(hesk_POST('max_length')), 1, 10000, 255);
|
||||||
|
@ -131,6 +131,8 @@ function hesk_custom_field_type($type)
|
|||||||
return $hesklang['date'];
|
return $hesklang['date'];
|
||||||
case 'hidden':
|
case 'hidden':
|
||||||
return $hesklang['sch'];
|
return $hesklang['sch'];
|
||||||
|
case 'readonly':
|
||||||
|
return $hesklang['readonly'];
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,8 @@ $hesklang['record_this_token_warning'] = 'Please record this token, as this is t
|
|||||||
$hesklang['all_tokens_revoked'] = 'All tokens for this user have been revoked';
|
$hesklang['all_tokens_revoked'] = 'All tokens for this user have been revoked';
|
||||||
$hesklang['staff_login_title'] = 'Staff Login';
|
$hesklang['staff_login_title'] = 'Staff Login';
|
||||||
$hesklang['manage_custom_fields'] = 'Manage Custom Fields';
|
$hesklang['manage_custom_fields'] = 'Manage Custom Fields';
|
||||||
|
$hesklang['value'] = 'Value';
|
||||||
|
$hesklang['readonly'] = 'Readonly';
|
||||||
|
|
||||||
// ADDED OR MODIFIED IN Mods for HESK 2.6.0
|
// ADDED OR MODIFIED IN Mods for HESK 2.6.0
|
||||||
$hesklang['search_logs'] = 'Search Logs';
|
$hesklang['search_logs'] = 'Search Logs';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user