2009-06-08 Esteban Sanchez <estebans@artica.es>

* godmode/setup/file_manager.php: Many fixes to the interface. Removed
        the dropdown menu when uploading a file, it now uploads it to the
        current dir, which is more natural. Do not show "No files found"
        anymore, because user may want to create subdirs. Fixes image for
        previous dir and show it again.

        * include/javascript/jquery.ui.datepicker.js: Changed default date
        format.

        * include/functions_filemanager.php: Changed
        get_file_manager_available_directories() to add subdirs too.
        Changed is_file_manager_writable_dir() to check if parent dir is
        writable.

        * operation/agentes/estado_agente.php: Use array filters instead
        of SQL code chunks.

        * operation/reporting/reporting_viewer.php: Fixed link to timeentry
        jQuery file.

        * images/status_sets/color_text/*, images/status_sets/default/*,
        images/pixel_yellow.png, images/pixel_gray.png,
        images/pixel_fucsia.png, images/pixel_red.png,
        images/pixel_black.png: Use Tango palette. Softer and cleaners
        colors.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1729 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2009-06-08 11:02:45 +00:00
parent a955f7db32
commit 00645938f4
38 changed files with 88 additions and 38 deletions

View File

@ -1,3 +1,31 @@
2009-06-08 Esteban Sanchez <estebans@artica.es>
* godmode/setup/file_manager.php: Many fixes to the interface. Removed
the dropdown menu when uploading a file, it now uploads it to the
current dir, which is more natural. Do not show "No files found"
anymore, because user may want to create subdirs. Fixes image for
previous dir and show it again.
* include/javascript/jquery.ui.datepicker.js: Changed default date
format.
* include/functions_filemanager.php: Changed
get_file_manager_available_directories() to add subdirs too.
Changed is_file_manager_writable_dir() to check if parent dir is
writable.
* operation/agentes/estado_agente.php: Use array filters instead
of SQL code chunks.
* operation/reporting/reporting_viewer.php: Fixed link to timeentry
jQuery file.
* images/status_sets/color_text/*, images/status_sets/default/*,
images/pixel_yellow.png, images/pixel_gray.png,
images/pixel_fucsia.png, images/pixel_red.png,
images/pixel_black.png: Use Tango palette. Softer and cleaners
colors.
2009-06-01 Sancho lerena <slerena@artica.es>
* extras/pandora_diag.php: Diagnostic tool. This reports some

View File

@ -88,10 +88,6 @@ if (preg_match ("/^manager/", $directory))
/* Add custom directories here */
$fallback_directory = "images";
$available_directories['images'] = "images";
$available_directories['attachment'] = "attachment";
$available_directories['languages'] = "languages";
$banned_directories['include'] = true;
$banned_directories['godmode'] = true;
$banned_directories['operation'] = true;
@ -111,10 +107,6 @@ $table->width = '50%';
$table->data = array ();
$table->data[0][0] = __('Directory');
$table->data[0][1] = print_select (get_file_manager_available_directories (),
'directory', $directory, 'this.form.submit()', '', '', true, false);
if (! is_file_manager_writable_dir ($real_directory)) {
echo "<h3 class='error'>".__('Current directory is not writable by HTTP Server')."</h3>";
echo '<p>';
@ -125,6 +117,7 @@ if (! is_file_manager_writable_dir ($real_directory)) {
$table->data[1][1] = print_input_file ('file', true, false);
$table->data[1][2] = print_submit_button (__('Go'), 'go', false,
'class="sub next"', true);
$table->data[1][2] .= print_input_hidden ('directory', $directory, true);
$table->data[1][2] .= print_input_hidden ('upload_file', 1, true);
}
@ -142,11 +135,6 @@ if (! is_dir ($real_directory)) {
$files = list_file_manager_dir ($real_directory);
if (count ($files) == 0) {
echo __('No files found');
return;
}
$table->width = '90%';
$table->class = 'listing';
@ -172,7 +160,7 @@ for ($i = 0; $i < (count ($prev_dir) - 1); $i++) {
}
if ($prev_dir_str != '') {
$table->data[0][0] = print_image ('go_previous.png', true);
$table->data[0][0] = print_image ('images/go_previous.png', true);
$table->data[0][1] = '<a href="index.php?sec=gsetup&amp;sec2=godmode/setup/file_manager&directory='.$prev_dir_str.'">';
$table->data[0][1] .= __('Parent directory');
$table->data[0][1] .='</a>';
@ -181,14 +169,14 @@ if ($prev_dir_str != '') {
}
if (is_writable ($real_directory)) {
$table->data[0][0] = print_image ('images/mimetypes/directory.png', true,
$table->data[1][0] = print_image ('images/mimetypes/directory.png', true,
array ('title' => __('Create directory')));
$table->data[0][1] = '<form method="post" action="index.php?sec=gsetup&amp;sec2=godmode/setup/file_manager">';
$table->data[0][1] .= print_input_text ('dirname', '', '', 15, 255, true);
$table->data[0][1] .= print_submit_button (__('Create'), 'crt', false, 'class="sub next"', true);
$table->data[0][1] .= print_input_hidden ('directory', $directory, true);
$table->data[0][1] .= print_input_hidden ('create_dir', 1, true);
$table->data[0][1] .= '</form>';
$table->data[1][1] = '<form method="post" action="index.php?sec=gsetup&amp;sec2=godmode/setup/file_manager">';
$table->data[1][1] .= print_input_text ('dirname', '', '', 15, 255, true);
$table->data[1][1] .= print_submit_button (__('Create'), 'crt', false, 'class="sub next"', true);
$table->data[1][1] .= print_input_hidden ('directory', $directory, true);
$table->data[1][1] .= print_input_hidden ('create_dir', 1, true);
$table->data[1][1] .= '</form>';
$table->colspan[0][1] = 5;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 B

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 195 B

View File

@ -106,11 +106,27 @@ if (!function_exists ('mime_content_type')) {
* operate.
*/
function get_file_manager_available_directories () {
global $config;
$dirs = array ();
$dirs['images'] = "images";
$dirs['attachment'] = "attachment";
$dirs['languages'] = "languages";
foreach ($dirs as $dirname) {
$dirpath = realpath ($config['homedir'].'/'.$dirname);
$dir = opendir ($dirpath);
while ($file = @readdir ($dir)) {
/* Ignore hidden files */
if ($file[0] == '.')
continue;
$filepath = $dirpath.'/'.$file;
if (is_dir ($filepath)) {
$dirs[$dirname.'/'.$file] = $dirname.'/'.$file;
}
}
}
return $dirs;
}
@ -124,6 +140,7 @@ function get_file_manager_available_directories () {
*/
function is_file_manager_available_directory ($dirname) {
$dirs = get_file_manager_available_directories ();
return isset ($dirs[$dirname]);
}
@ -136,10 +153,13 @@ function is_file_manager_available_directory ($dirname) {
* @param bool Wheter the directory is writeable or not.
*/
function is_file_manager_writable_dir ($dirpath, $force = false) {
if (! is_file_manager_available_directory (basename ($dirpath)))
return false;
if (! $force)
if (is_file_manager_available_directory (basename ($dirpath)))
return is_writable ($dirpath);
if (is_file_manager_writable_dir (realpath ($dirpath.'/..')))
return true;
else if (! $force)
return is_writable ($dirpath);
return (is_writable ($dirpath) || @chmod ($dirpath, 0755));
}

File diff suppressed because one or more lines are too long

View File

@ -77,32 +77,46 @@ print_submit_button (__('Search'), "srcbutton", '', array ("class" => "sub"));
echo '</td><td style="width:40%;">&nbsp;</td></tr></table></form>';
if ($search != ""){
$search_sql = array ("string" => '%'.$search.'%');
$filter = array ("string" => '%'.$search.'%');
} else {
$search_sql = array ();
$filter = array ();
}
// Show only selected groups
if ($group_id > 1) {
$agent_names = get_group_agents ($group_id, $search_sql, "upper");
$groups = $group_id;
$agent_names = get_group_agents ($group_id, $filter, "upper");
// Not selected any specific group
} else {
$user_group = get_user_groups ($config["id_user"], "AR");
$agent_names = get_group_agents (array_keys ($user_group), $search_sql, "upper");
$groups = array_keys ($user_group);
$agent_names = get_group_agents (array_keys ($user_group), $filter, "upper");
}
$num_agents = 0;
if (!empty ($agent_names)) {
$num_agents = get_db_sql (sprintf ("SELECT COUNT(*) FROM tagente WHERE id_agente IN (%s)", implode (",", array_keys ($agent_names))));
$agents = get_db_all_rows_sql (sprintf ("SELECT * FROM tagente WHERE id_agente IN (%s) ORDER BY nombre ASC LIMIT %d,%d", implode (",", array_keys ($agent_names)), (int) get_parameter ("offset"), $config["block_size"]));
}
$total_agents = 0;
$agents = false;
if (! empty ($agent_names)) {
$total_agents = get_agents (array (//'id_agente' => array_keys ($agent_names),
'order' => 'nombre ASC',
'id_grupo' => $groups),
array ('COUNT(*) as total'));
$total_agents = isset ($total_agents[0]['total']) ? $total_agents[0]['total'] : 0;
$agents = get_agents (array ('id_agente' => array_keys ($agent_names),
'order' => 'nombre ASC',
'id_grupo' => $groups,
'offset' => (int) get_parameter ('offset'),
'limit' => (int) $config['block_size']),
array ('id_agente',
'id_grupo',
'id_os',
'intervalo'));}
if (empty ($agents)) {
$agents = array ();
}
// Prepare pagination
pagination ($num_agents, get_url_refresh (array ('group_id' => $group_id, 'search' => $search)));
pagination ($total_agents, get_url_refresh (array ('group_id' => $group_id, 'search' => $search)));
// Show data.
$table->cellpadding = 4;

View File

@ -86,7 +86,7 @@ echo '</div>';
require_css_file ('datepicker');
require_jquery_file ('ui.core');
require_jquery_file ('ui.datepicker');
require_jquery_file ('ui.timeentry');
require_jquery_file ('timeentry');
?>
<script language="javascript" type="text/javascript">
@ -117,7 +117,7 @@ $group_name = get_group_name ($report['id_group']);
$contents = get_db_all_rows_field_filter ("treport_content", "id_report", $id_report, "`order`");
if ($contents === false) {
return;
};
}
foreach ($contents as $content) {
$table->data = array ();
$table->head = array ();