diff --git a/lib/classes/caption/field.class.php b/lib/classes/caption/field.class.php index d15d4cb1d8..1b343b8e9f 100644 --- a/lib/classes/caption/field.class.php +++ b/lib/classes/caption/field.class.php @@ -206,6 +206,9 @@ class caption_field implements cache_cacheableInterface */ protected static function serialize_value(Array $value, $separator) { + if(strlen($separator) > 1) + $separator = $separator[0]; + if (trim($separator) === '') $separator = ' '; else diff --git a/lib/classes/task/manager.class.php b/lib/classes/task/manager.class.php index 6c5c69ad37..51767999d7 100644 --- a/lib/classes/task/manager.class.php +++ b/lib/classes/task/manager.class.php @@ -112,5 +112,44 @@ class task_manager return $row; } + + public static function getAvailableTasks() + { + $registry = registry::get_instance(); + $taskdir = array( $registry->get('GV_RootPath') . "lib/classes/task/period/" + , $registry->get('GV_RootPath') . "config/classes/task/period/" + ); + $tasks = array(); + foreach($taskdir as $path) + { + if( ($hdir = @opendir($path)) ) + { + $tskin = array(); + $max = 9999; + while (($max-- > 0) && (($file = readdir($hdir)) !== false)) + { + if (!is_file($path . '/' . $file) || substr($file, 0, 1) == "." || substr($file, -10) != ".class.php") + continue; + + $classname = 'task_period_' . substr($file, 0, strlen($file) - 10); + + try + { + // $testclass = new $classname(null); + if ($classname::interfaceAvailable()) + { + $tasks[] = array("class" => $classname, "name" => $classname::getName(), "err" => null); + } + } + catch (Exception $e) + { + + } + } + closedir($hdir); + } + } + return $tasks; + } } diff --git a/templates/web/admin/task.html b/templates/web/admin/task.html index eb35b69976..34ffc87d5d 100644 --- a/templates/web/admin/task.html +++ b/templates/web/admin/task.html @@ -1,440 +1,449 @@ -
- - - - {{task.printInterfaceHEAD()}} - - + + + - - {{task.printInterfaceJS()}} - + + + {{task.printInterfaceJS()}} + - + - -