some more migrating to new settings class, refs #1325
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -360,8 +360,7 @@ if ($page == 'customers'
|
||||
if ($tickets !== false && isset($tickets[0])) {
|
||||
foreach ($tickets as $ticket) {
|
||||
$now = time();
|
||||
// FIXME ticket -> settings
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$ticket);
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$ticket);
|
||||
$mainticket->Set('lastchange', $now, true, true);
|
||||
$mainticket->Set('lastreplier', '1', true, true);
|
||||
$mainticket->Set('status', '3', true, true);
|
||||
|
||||
@@ -15,60 +15,47 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function buildFormEx($form, $part = '')
|
||||
{
|
||||
global $settings, $theme;
|
||||
function buildFormEx($form, $part = '') {
|
||||
|
||||
$fields = '';
|
||||
|
||||
if(validateFormDefinition($form))
|
||||
{
|
||||
foreach($form['groups'] as $groupname => $groupdetails)
|
||||
{
|
||||
if (validateFormDefinition($form)) {
|
||||
foreach ($form['groups'] as $groupname => $groupdetails) {
|
||||
// show overview
|
||||
if($part == '')
|
||||
{
|
||||
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
|
||||
{
|
||||
if ($part == '') {
|
||||
if (isset($groupdetails['title']) && $groupdetails['title'] != '') {
|
||||
$fields .= getFormOverviewGroupOutput($groupname, $groupdetails);
|
||||
}
|
||||
}
|
||||
// only show one section
|
||||
elseif($part != '' && ($groupname == $part || $part == 'all'))
|
||||
{
|
||||
elseif ($part != '' && ($groupname == $part || $part == 'all')) {
|
||||
/**
|
||||
* this part checks for the 'websrv_avail' entry in the settings-array
|
||||
* if found, we check if the current webserver is in the array. If this
|
||||
* is not the case, we change the setting type to "hidden", #502
|
||||
*/
|
||||
$do_show = true;
|
||||
if(isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail']))
|
||||
{
|
||||
$websrv = $settings['system']['webserver'];
|
||||
if(!in_array($websrv, $groupdetails['websrv_avail']))
|
||||
{
|
||||
if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) {
|
||||
$websrv = Settings::Get('system.webserver');
|
||||
if (!in_array($websrv, $groupdetails['websrv_avail'])) {
|
||||
$do_show = false;
|
||||
}
|
||||
}
|
||||
|
||||
if($do_show)
|
||||
{
|
||||
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
|
||||
{
|
||||
if ($do_show) {
|
||||
if (isset($groupdetails['title']) && $groupdetails['title'] != '') {
|
||||
$fields .= getFormGroupOutput($groupname, $groupdetails);
|
||||
}
|
||||
|
||||
if(validateFieldDefinition($groupdetails))
|
||||
{
|
||||
|
||||
if (validateFieldDefinition($groupdetails)) {
|
||||
// Prefetch form fields
|
||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||
{
|
||||
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
|
||||
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
||||
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
||||
}
|
||||
|
||||
|
||||
// Collect form field output
|
||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||
{
|
||||
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
|
||||
$fields .= getFormFieldOutput($fieldname, $fielddetails);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function getFormGroupOutput($groupname, $groupdetails)
|
||||
{
|
||||
function getFormGroupOutput($groupname, $groupdetails) {
|
||||
|
||||
global $lng, $theme;
|
||||
eval("\$group = \"" . getTemplate("settings/settings_group") . "\";");
|
||||
return $group;
|
||||
}
|
||||
|
||||
function getFormOverviewGroupOutput($groupname, $groupdetails)
|
||||
{
|
||||
global $lng, $settings, $filename, $s, $theme;
|
||||
|
||||
function getFormOverviewGroupOutput($groupname, $groupdetails) {
|
||||
|
||||
global $lng, $filename, $s, $theme;
|
||||
|
||||
$group = '';
|
||||
$title = $groupdetails['title'];
|
||||
$part = $groupname;
|
||||
@@ -53,7 +53,7 @@ function getFormOverviewGroupOutput($groupname, $groupdetails)
|
||||
$options = '';
|
||||
foreach($options_array as $value => $vtitle)
|
||||
{
|
||||
$options .= makeoption($vtitle, $value, $settings[$fielddetails['settinggroup']][$fielddetails['varname']]);
|
||||
$options .= makeoption($vtitle, $value, Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname']));
|
||||
}
|
||||
$option.= $fielddetails['label'].': ';
|
||||
$option.= '<select class="dropdown_noborder" name="'.$fieldname.'">';
|
||||
@@ -64,30 +64,27 @@ function getFormOverviewGroupOutput($groupname, $groupdetails)
|
||||
else
|
||||
{
|
||||
$option.= $lng['admin']['activated'].': ';
|
||||
$option.= makeyesno($fieldname, '1', '0', $settings[$fielddetails['settinggroup']][$fielddetails['varname']]);
|
||||
$activated = (int)$settings[$fielddetails['settinggroup']][$fielddetails['varname']];
|
||||
$option.= makeyesno($fieldname, '1', '0', Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname']));
|
||||
$activated = (int)Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this part checks for the 'websrv_avail' entry in the settings-array
|
||||
* this part checks for the 'websrv_avail' entry in the settings
|
||||
* if found, we check if the current webserver is in the array. If this
|
||||
* is not the case, we change the setting type to "hidden", #502
|
||||
*/
|
||||
$do_show = true;
|
||||
if(isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail']))
|
||||
{
|
||||
$websrv = $settings['system']['webserver'];
|
||||
if(!in_array($websrv, $groupdetails['websrv_avail']))
|
||||
{
|
||||
if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) {
|
||||
$websrv = Settings::Get('system.webserver');
|
||||
if (!in_array($websrv, $groupdetails['websrv_avail'])) {
|
||||
$do_show = false;
|
||||
}
|
||||
}
|
||||
|
||||
if($do_show)
|
||||
{
|
||||
if ($do_show) {
|
||||
eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");
|
||||
}
|
||||
return $group;
|
||||
|
||||
Reference in New Issue
Block a user