2009-03-04 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/module_manager_editor.php: Fixed filter field on get_module_components ajax operation and order the results. * include/functions.php: Added enterprise_include_once(). * include/functions_modules.php: Use get_db_all_rows_filter() on get_network_component(). Also added fields to this function. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1504 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
3a7d93b3b6
commit
30edb7dfd7
|
@ -1,3 +1,13 @@
|
||||||
|
2009-03-04 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
|
* godmode/agentes/module_manager_editor.php: Fixed filter field on
|
||||||
|
get_module_components ajax operation and order the results.
|
||||||
|
|
||||||
|
* include/functions.php: Added enterprise_include_once().
|
||||||
|
|
||||||
|
* include/functions_modules.php: Use get_db_all_rows_filter() on
|
||||||
|
get_network_component(). Also added fields to this function.
|
||||||
|
|
||||||
2009-03-03 Evi Vanoost <vanooste@rcbi.rochester.edu>
|
2009-03-03 Evi Vanoost <vanooste@rcbi.rochester.edu>
|
||||||
|
|
||||||
* general/logon_ok.php: Minor edit in language and colors for warning
|
* general/logon_ok.php: Minor edit in language and colors for warning
|
||||||
|
|
|
@ -37,7 +37,9 @@ if (is_ajax ()) {
|
||||||
$id_module_component = (int) get_parameter ('id_module_component_type');
|
$id_module_component = (int) get_parameter ('id_module_component_type');
|
||||||
|
|
||||||
$components = get_network_components ($id_module_component,
|
$components = get_network_components ($id_module_component,
|
||||||
array ('id_module_group' => $id_module_group));
|
array ('id_group' => $id_module_group,
|
||||||
|
'order' => 'name ASC'),
|
||||||
|
array ('id_nc', 'name'));
|
||||||
|
|
||||||
echo json_encode ($components);
|
echo json_encode ($components);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -843,6 +843,19 @@ function enterprise_include ($filename) {
|
||||||
return ENTERPRISE_NOT_HOOK;
|
return ENTERPRISE_NOT_HOOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enterprise_include_once ($filename) {
|
||||||
|
global $config;
|
||||||
|
// Load enterprise extensions
|
||||||
|
$filepath = realpath ($config["homedir"].'/'.ENTERPRISE_DIR.'/'.$filename);
|
||||||
|
if ($filepath === false)
|
||||||
|
return ENTERPRISE_NOT_HOOK;
|
||||||
|
if (file_exists ($filepath)) {
|
||||||
|
include_once ($filepath);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return ENTERPRISE_NOT_HOOK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//These are wrapper functions for PHP. Don't document them
|
//These are wrapper functions for PHP. Don't document them
|
||||||
if (!function_exists ("mb_strtoupper")) {
|
if (!function_exists ("mb_strtoupper")) {
|
||||||
|
|
|
@ -81,26 +81,19 @@ function copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent) {
|
||||||
* joined with an AND operator). Examples:
|
* joined with an AND operator). Examples:
|
||||||
<code>
|
<code>
|
||||||
$components = get_network_components ($id_module, array ('id_module_group', 10));
|
$components = get_network_components ($id_module, array ('id_module_group', 10));
|
||||||
$components = get_network_components ($id_module, array ('id_module_group', 10));
|
$components = get_network_components ($id_module, 'id_module_group = 10'));
|
||||||
</code>
|
</code>
|
||||||
|
* @param mixed Fields to retrieve on each component.
|
||||||
*
|
*
|
||||||
* @return array A list of network components matching. Empty array is returned
|
* @return array A list of network components matching. Empty array is returned
|
||||||
* if none matches.
|
* if none matches.
|
||||||
*/
|
*/
|
||||||
function get_network_components ($id_module, $filter = false) {
|
function get_network_components ($id_module, $filter = false, $fields = false) {
|
||||||
if (empty ($id_module))
|
if (empty ($id_module))
|
||||||
return array ();
|
return array ();
|
||||||
|
|
||||||
$where = '';
|
$components = get_db_all_rows_filter ('tnetwork_component',
|
||||||
if (is_array ($filter)) {
|
$filter, $fields);
|
||||||
$where = format_array_to_where_clause_sql ($filter, 'AND', ' AND ');
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = sprintf ('SELECT * FROM tnetwork_component
|
|
||||||
WHERE `id_modulo` = %d %s',
|
|
||||||
$id_module, $where);
|
|
||||||
|
|
||||||
$components = get_db_all_rows_sql ($sql);
|
|
||||||
if ($components === false)
|
if ($components === false)
|
||||||
return array ();
|
return array ();
|
||||||
return $components;
|
return $components;
|
||||||
|
|
Loading…
Reference in New Issue