mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
minor fix - group containers must be rebuilt...
This commit is contained in:
parent
6962c34f48
commit
b102d42793
@ -132,7 +132,7 @@ if ($edit_container) {
|
|||||||
$id_parent = get_parameter('id_parent', 0);
|
$id_parent = get_parameter('id_parent', 0);
|
||||||
$description = io_safe_input(get_parameter('description', ''));
|
$description = io_safe_input(get_parameter('description', ''));
|
||||||
$id_group = get_parameter('container_id_group', 0);
|
$id_group = get_parameter('container_id_group', 0);
|
||||||
} else {
|
} else if ((bool) $id_container !== false) {
|
||||||
$tcontainer = db_get_row_sql('SELECT * FROM tcontainer WHERE id_container = '.$id_container);
|
$tcontainer = db_get_row_sql('SELECT * FROM tcontainer WHERE id_container = '.$id_container);
|
||||||
$name = $tcontainer['name'];
|
$name = $tcontainer['name'];
|
||||||
$id_parent = $tcontainer['parent'];
|
$id_parent = $tcontainer['parent'];
|
||||||
@ -142,6 +142,7 @@ if ($edit_container) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($add_container) {
|
if ($add_container) {
|
||||||
|
if ((bool) $name !== false) {
|
||||||
$values = [
|
$values = [
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
@ -149,6 +150,13 @@ if ($add_container) {
|
|||||||
'id_group' => $id_group,
|
'id_group' => $id_group,
|
||||||
];
|
];
|
||||||
$id_container = db_process_sql_insert('tcontainer', $values);
|
$id_container = db_process_sql_insert('tcontainer', $values);
|
||||||
|
} else {
|
||||||
|
$error = ui_print_error_message(
|
||||||
|
__('Container name is missing.'),
|
||||||
|
'',
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($update_container) {
|
if ($update_container) {
|
||||||
@ -188,6 +196,9 @@ ui_print_page_header(
|
|||||||
|
|
||||||
if ($add_container) {
|
if ($add_container) {
|
||||||
ui_print_result_message($id_container, __('Container stored successfully'), __('There was a problem storing container'));
|
ui_print_result_message($id_container, __('Container stored successfully'), __('There was a problem storing container'));
|
||||||
|
if (empty($error) === false) {
|
||||||
|
echo $error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($update_container) {
|
if ($update_container) {
|
||||||
@ -207,6 +218,8 @@ if ($id_container === '1') {
|
|||||||
echo "<td class='datos' style='width: 27%;'><input type='text' name='name' size='30' disabled='1'";
|
echo "<td class='datos' style='width: 27%;'><input type='text' name='name' size='30' disabled='1'";
|
||||||
} else {
|
} else {
|
||||||
echo "<td class='datos' style='width: 27%;'><input type='text' name='name' size='30' ";
|
echo "<td class='datos' style='width: 27%;'><input type='text' name='name' size='30' ";
|
||||||
|
// Using latest style...
|
||||||
|
echo ' required ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($edit_container) {
|
if ($edit_container) {
|
||||||
@ -223,12 +236,22 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
|||||||
|
|
||||||
echo "<td style='width: 12%;'><b>".__('Group').'</b></td><td>';
|
echo "<td style='width: 12%;'><b>".__('Group').'</b></td><td>';
|
||||||
echo '<div class="w250px">';
|
echo '<div class="w250px">';
|
||||||
if ($id_container === '1') {
|
echo html_print_input(
|
||||||
echo html_print_select_groups($config['id_user'], '', $return_all_groups, 'container_id_group', $id_group, '', '', '', true, false, true, '', true);
|
[
|
||||||
} else {
|
'type' => 'select_groups',
|
||||||
echo html_print_select_groups($config['id_user'], '', $return_all_groups, 'container_id_group', $id_group, '', '', '', true, false, true, '', false);
|
'id_user' => $config['id_user'],
|
||||||
}
|
'privilege' => 'RW',
|
||||||
|
'returnAllGroup' => $return_all_groups,
|
||||||
|
'name' => 'container_id_group',
|
||||||
|
'selected' => $id_group,
|
||||||
|
'script' => '',
|
||||||
|
'nothing' => '',
|
||||||
|
'nothing_value' => '',
|
||||||
|
'return' => false,
|
||||||
|
'required' => true,
|
||||||
|
'disabled' => ($id_container === '1'),
|
||||||
|
]
|
||||||
|
);
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '</td></tr>';
|
echo '</td></tr>';
|
||||||
|
|
||||||
@ -575,11 +598,13 @@ if ($edit_container) {
|
|||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
|
||||||
|
if ((bool) $id_container !== false) {
|
||||||
$total_item = db_get_all_rows_sql('SELECT count(*) FROM tcontainer_item WHERE id_container = '.$id_container);
|
$total_item = db_get_all_rows_sql('SELECT count(*) FROM tcontainer_item WHERE id_container = '.$id_container);
|
||||||
$result_item = db_get_all_rows_sql('SELECT * FROM tcontainer_item WHERE id_container = '.$id_container.' LIMIT 10 OFFSET '.$offset);
|
$result_item = db_get_all_rows_sql('SELECT * FROM tcontainer_item WHERE id_container = '.$id_container.' LIMIT 10 OFFSET '.$offset);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$result_item) {
|
if (!$result_item) {
|
||||||
echo "<div class='nf'>".__('There are no defined item container').'</div>';
|
echo "<div class='nf'>".__('There are no items in this container.').'</div>';
|
||||||
} else {
|
} else {
|
||||||
ui_pagination($total_item[0]['count(*)'], false, $offset, 10);
|
ui_pagination($total_item[0]['count(*)'], false, $offset, 10);
|
||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user