diff --git a/admin/inc/class.admin_customfields.inc.php b/admin/inc/class.admin_customfields.inc.php
index 6484a87310..77f9420513 100644
--- a/admin/inc/class.admin_customfields.inc.php
+++ b/admin/inc/class.admin_customfields.inc.php
@@ -431,7 +431,10 @@ class admin_customfields
$test = new Etemplate();
if($test->read($this->appname.'.admin.types')) $this->manage_content_types = true;
- $this->tmpl = new Etemplate();
+ if(is_null($this->tmpl))
+ {
+ $this->tmpl = new Etemplate();
+ }
$this->tmpl->read('admin.customfield_edit');
Api\Translation::add_app('infolog'); // til we move the translations
@@ -502,13 +505,14 @@ class admin_customfields
}
$content['statustext'] = $content['options'][$content['cf_type']];
$content['attributes'] = self::$type_attribute_flags;
+ $exec = static::class == 'admin_customfields' ? 'admin.admin_customfields.edit' : $this->appname . '.' . static::class . '.edit';
- $this->tmpl->exec('admin.admin_customfields.edit',$content,$sel_options,$readonlys,array(
- 'cf_id' => $cf_id,
- 'cf_app' => $this->appname,
- 'cf_name' => $content['cf_name'],
+ $this->tmpl->exec($exec, $content, $sel_options, $readonlys, array(
+ 'cf_id' => $cf_id,
+ 'cf_app' => $this->appname,
+ 'cf_name' => $content['cf_name'],
'use_private' => $this->use_private,
- ),2);
+ ), 2);
}
/**
diff --git a/admin/templates/default/customfields.xet b/admin/templates/default/customfields.xet
index baa611b815..82b2dac7a1 100644
--- a/admin/templates/default/customfields.xet
+++ b/admin/templates/default/customfields.xet
@@ -58,26 +58,27 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/inc/class.resources_customfields.inc.php b/resources/inc/class.resources_customfields.inc.php
new file mode 100644
index 0000000000..9bdca1d4d9
--- /dev/null
+++ b/resources/inc/class.resources_customfields.inc.php
@@ -0,0 +1,59 @@
+bo = new resources_bo();
+ $this->tmpl = new Etemplate();
+
+ // For index - override so "add" button opens correctly
+ $this->tmpl->setElementAttribute("nm", "header_left", "resources.customfields.add");
+
+ $content_types = $this->bo->acl->get_cats(Acl::ADD);
+ array_walk($content_types, function ($name, $id)
+ {
+ $this->content_types[$id] = array('name' => $name);
+ });
+
+ Api\Translation::add_app('resources');
+ }
+
+ public function edit($content = null)
+ {
+ // Turn private off
+ $_GET['use_private'] = false;
+ unset($content['use_private']);
+
+ parent::edit($content);
+ }
+}
diff --git a/resources/inc/class.resources_hooks.inc.php b/resources/inc/class.resources_hooks.inc.php
index ceac6f92d4..f22e91d0ab 100644
--- a/resources/inc/class.resources_hooks.inc.php
+++ b/resources/inc/class.resources_hooks.inc.php
@@ -52,18 +52,22 @@ class resources_hooks
if ($GLOBALS['egw_info']['user']['apps']['admin'])
{
- $file = Array(
- 'Site Configuration' => Egw::link('/index.php','menuaction=admin.admin_config.index&appname=' . $appname.'&ajax=true'),
- 'Global Categories' => Egw::link('/index.php',array(
- 'menuaction' => 'admin.admin_categories.index',
- 'appname' => $appname,
- 'global_cats'=> true,
- 'ajax' => 'true'
+ $file = array(
+ 'Site Configuration' => Egw::link('/index.php', 'menuaction=admin.admin_config.index&appname=' . $appname . '&ajax=true'),
+ 'Global Categories' => Egw::link('/index.php', array(
+ 'menuaction' => 'admin.admin_categories.index',
+ 'appname' => $appname,
+ 'global_cats' => true,
+ 'ajax' => 'true'
)),
- 'Configure Access Permissions' => Egw::link('/index.php',
- 'menuaction=resources.resources_acl_ui.index&ajax=true'),
- 'Custom Fields'=>egw::link('/index.php',
- 'menuaction=admin.admin_customfields.index&appname=resources&ajax=true'),
+ 'Configure Access Permissions' => Egw::link(
+ '/index.php',
+ 'menuaction=resources.resources_acl_ui.index&ajax=true'
+ ),
+ 'Custom Fields' => egw::link(
+ '/index.php',
+ 'menuaction=resources.resources_customfields.index&appname=resources&ajax=true'
+ ),
);
if ($location == 'admin')
{
diff --git a/resources/templates/default/admin.types.xet b/resources/templates/default/admin.types.xet
new file mode 100644
index 0000000000..c0309cfa75
--- /dev/null
+++ b/resources/templates/default/admin.types.xet
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+ .header{
+ font-weight: bold;
+ }
+
+
+
diff --git a/resources/templates/default/edit.xet b/resources/templates/default/edit.xet
index c58316fc85..05b302cd2c 100644
--- a/resources/templates/default/edit.xet
+++ b/resources/templates/default/edit.xet
@@ -113,7 +113,7 @@
-
+
@@ -141,16 +141,16 @@
-
+