Skip to content
Snippets Groups Projects
Commit 0c7072ea authored by Giovannoni Laurent's avatar Giovannoni Laurent
Browse files

evo: action process rm

parent d3446006
No related branches found
No related tags found
No related merge requests found
...@@ -136,18 +136,23 @@ elseif(trim($_POST['req']) == 'change_status' && !empty($_POST['values']) && !em ...@@ -136,18 +136,23 @@ elseif(trim($_POST['req']) == 'change_status' && !empty($_POST['values']) && !em
$arr_id = explode(',', $_POST['values']); $arr_id = explode(',', $_POST['values']);
$result = ''; $result = '';
$db->connect(); $db->connect();
for($i=0; $i<count($arr_id );$i++) for ($i=0; $i<count($arr_id );$i++) {
{
$arr_id[$i] = str_replace('#', '', $arr_id[$i]); $arr_id[$i] = str_replace('#', '', $arr_id[$i]);
$result .= $arr_id[$i].'#'; $result .= $arr_id[$i].'#';
$query_str = "update ".$_POST['table']. " set status = '".$_POST['new_status']."' where res_id = ".$arr_id[$i]; if (trim($_POST['new_status']) <> '') {
// echo $query_str; if ($_POST['table'] == 'rm_ios') {
$req = $db->query($query_str, true); $query_str = "update " . $_POST['table'] . " set status = '"
if(!$req) . $_POST['new_status'] . "' where io_id = " . $arr_id[$i];
{ } else {
$_SESSION['action_error'] = _SQL_ERROR.' : '.$query_str; $query_str = "update " . $_POST['table'] . " set status = '"
echo "{status : 1, error_txt : '".addslashes(_ERROR_WITH_STATUS)." ".$query_str."'}"; . $_POST['new_status'] . "' where res_id = " . $arr_id[$i];
exit(); }
$req = $db->query($query_str, true);
if (!$req) {
$_SESSION['action_error'] = _SQL_ERROR.' : '.$query_str;
echo "{status : 1, error_txt : '".addslashes(_ERROR_WITH_STATUS)." ".$query_str."'}";
exit();
}
} }
} }
echo "{status : 0, error_txt : '".addslashes(_STATUS_UPDATED.' : '.$_POST['new_status'])."'}"; echo "{status : 0, error_txt : '".addslashes(_STATUS_UPDATED.' : '.$_POST['new_status'])."'}";
...@@ -207,17 +212,23 @@ else ...@@ -207,17 +212,23 @@ else
// Update the status // Update the status
$result = ''; $result = '';
for($i=0; $i<count($arr_id );$i++) for ($i=0;$i<count($arr_id );$i++) {
{
$arr_id[$i] = str_replace('#', '', $arr_id[$i]); $arr_id[$i] = str_replace('#', '', $arr_id[$i]);
$result .= $arr_id[$i].'#'; $result .= $arr_id[$i].'#';
$query_str = "update ".$_POST['table']. " set status = '".$status."' where res_id = ".$arr_id[$i]; if (trim($status) <> '') {
$req = $db->query($query_str, true); if ($_POST['table'] == 'rm_ios') {
if(!$req) $query_str = "update " . $_POST['table'] . " set status = '"
{ . $status . "' where io_id = " . $arr_id[$i];
$_SESSION['action_error'] = _SQL_ERROR.' : '.$query_str; } else {
echo "{status : 7, error_txt : '".addslashes($label_action.' : '.$_SESSION['action_error'])."'}"; $query_str = "update " . $_POST['table'] . " set status = '"
exit(); . $status . "' where res_id = " . $arr_id[$i];
}
$req = $db->query($query_str, true);
if (!$req) {
$_SESSION['action_error'] = _SQL_ERROR . ' : ' . $query_str;
echo "{status : 7, error_txt : '" . addslashes($label_action . ' : ' . $_SESSION['action_error']) . "'}";
exit();
}
} }
} }
$res_action = array('result' => $result, 'history_msg' => ''); $res_action = array('result' => $result, 'history_msg' => '');
......
...@@ -135,4 +135,12 @@ An action page is described in a ACTIONPAGE tag : ...@@ -135,4 +135,12 @@ An action page is described in a ACTIONPAGE tag :
<KEYWORD>indexing</KEYWORD> <KEYWORD>indexing</KEYWORD>
<FLAG_CREATE>true</FLAG_CREATE> <FLAG_CREATE>true</FLAG_CREATE>
</ACTIONPAGE> </ACTIONPAGE>
<ACTIONPAGE>
<ID>process_rm</ID>
<LABEL>_PROCESS_ARCHIVE</LABEL>
<NAME>process_rm</NAME>
<ORIGIN>module</ORIGIN>
<MODULE>records_management</MODULE>
<FLAG_CREATE>false</FLAG_CREATE>
</ACTIONPAGE>
</ROOT> </ROOT>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment