From 94c9617ebd5497ae8801a0c6e4b30999fcf23872 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Fri, 10 Jan 2014 09:17:39 -0500
Subject: [PATCH] - Added support for reseller templates. - Resellers can use templates for their clients.
---
interface/web/client/templates/reseller_edit_limits.htm | 79 +++++++++++++++++++++++++++++++--------
1 files changed, 62 insertions(+), 17 deletions(-)
diff --git a/interface/web/client/templates/reseller_edit_limits.htm b/interface/web/client/templates/reseller_edit_limits.htm
index a115dc8..0d3cb19 100644
--- a/interface/web/client/templates/reseller_edit_limits.htm
+++ b/interface/web/client/templates/reseller_edit_limits.htm
@@ -3,29 +3,44 @@
<div class="panel panel_client">
+ <tmpl_if name="is_admin">
+ <div class="pnl_toolsarea">
+ <fieldset><legend>{tmpl_var name="toolsarea_head_txt"}</legend>
+ <div class="buttons topbuttons">
+ <button class="positive iconstxt icoAdd" type="button" value="{tmpl_var name='add_additional_template_txt'}" onclick="addAdditionalTemplate();"><span>{tmpl_var name='add_additional_template_txt'}</span></button>
+ </div>
+ </fieldset>
+ </div>
+ </tmpl_if>
+
<div class="pnl_formsarea">
<fieldset class="inlineLabels"><legend>Limits</legend>
- <!--
- <tmpl_if name="is_admin">
- <div class="ctrlHolder">
+ <tmpl_if name="is_admin">
+ <div class="ctrlHolder">
<label for="template_master">{tmpl_var name='template_master_txt'}</label>
<select name="template_master" id="template_master" class="selectInput">
- {tmpl_var name='template_master'}
- </select>
- </div>
- <div class="ctrlHolder">
+ {tmpl_var name='template_master'}
+ </select>
+ </div>
+ <div class="ctrlHolder">
<label for="template_additional">{tmpl_var name='template_additional_txt'}</label>
<select name="tpl_add_select" id="tpl_add_select" class="selectInput">
- {tmpl_var name='tpl_add_select'}
- </select>
- <span id="template_additional_list">{tmpl_var name='template_additional_list'}</span>
- <input type="hidden" id="template_additional" name="template_additional" value="{tmpl_var name='template_additional'}">
- </div>
- <div class="ctrlHolder">
-
- </div>
+ {tmpl_var name='tpl_add_select'}
+ </select>
+ </div>
+ <div class="ctrlHolder">
+ <p class="label">{tmpl_var name='active_template_additional_txt'}</p>
+ <div id="template_additional_list" class="multiField">
+ <ul>
+ {tmpl_var name='template_additional_list'}
+ </ul>
+ </div>
+ <input type="hidden" id="template_additional" name="template_additional" value="{tmpl_var name='template_additional'}">
+ </div>
+ <div class="ctrlHolder">
+
+ </div>
</tmpl_if>
- -->
<div class="ctrlHolder">
<label for="limit_client">{tmpl_var name='limit_client_txt'}</label>
<input name="limit_client" id="limit_client" value="{tmpl_var name='limit_client'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
@@ -301,4 +316,34 @@
</div>
</div>
-</div>
\ No newline at end of file
+</div>
+<tmpl_if name="is_admin">
+<script type="text/javascript">
+<!--
+function custom_template_selected() {
+ return ($('#template_master').val() == '0' ? true : false);
+}
+
+jQuery('#template_additional_list').find('li > a').click(function(e) {
+ e.preventDefault();
+ delAdditionalTemplate($(this).parent().attr('rel'));
+});
+
+jQuery('div.panel_client')
+ .find('div.pnl_formsarea')
+ .find('fieldset')
+ .find('input,select,button')
+ .not('#template_master,#template_additional,#default_mailserver,#default_webserver,#default_dbserver,#default_dnsserver,#default_slave_dnsserver')
+ .click(function(e) {
+ if(custom_template_selected()) return true;
+ e.preventDefault();
+ alert('{tmpl_var name="err_msg_master_tpl_set"}');
+ })
+ .focus(function() {
+ if(custom_template_selected()) return true;
+ $(this).blur();
+ });
+
+//-->
+</script>
+</tmpl_if>
\ No newline at end of file
--
Gitblit v1.9.1