query('select label_action from actions where id = ?', [$id_action]); $resAction = $stmt->fetchObject(); $labelAction = functions::show_string($resAction->label_action); } $frm_str = '
'; if ($labelAction != '') { $frm_str .= '

' . $labelAction . ' ' . _NUM; } else { $frm_str .= '

' . _REDIRECT_MAIL . ' ' ._NUM; } $values_str = ''; if(empty($_SESSION['stockCheckbox'])) { for($i=0; $i < count($values); $i++) { $values_str .= $values[$i] . ', '; } } else { for($i=0; $i < count($_SESSION['stockCheckbox']); $i++) { $values_str .= $_SESSION['stockCheckbox'][$i].', '; } } $values_str = preg_replace('/, $/', '', $values_str); if(_ID_TO_DISPLAY == 'res_id'){ $frm_str .= $values_str; } else if (_ID_TO_DISPLAY == 'chrono_number'){ $chrono_number = $cr7->get_chrono_number($values_str, 'res_view_letterbox'); $frm_str .= $chrono_number; } $frm_str .= '


'; require 'modules/templates/class/templates_controler.php'; $templatesControler = new templates_controler(); $EntitiesIdExclusion = []; $entities = $entity_ctrl->getAllEntities(); $countEntities = count($entities); for ($cptAllEnt = 0;$cptAllEnt<$countEntities;$cptAllEnt++) { if (!is_integer(array_search($entities[$cptAllEnt]->__get('entity_id'), $servicesCompare))) { array_push($EntitiesIdExclusion, $entities[$cptAllEnt]->__get('entity_id')); } } $templates = $templatesControler->getAllTemplatesForSelect(); $frm_str .='
'. _NOTES .':
'; $frm_str .= ''; $frm_str .= ''; $frm_str .= ''; $frm_str .= ''; $frm_str .= '
'; $frm_str .= '
'; $frm_str .= ' '; $frm_str .= ' '; $frm_str .= '
'; return addslashes($frm_str); } function check_form($form_id, $values) { return true; } function manage_form($arr_id, $history, $id_action, $label_action, $status, $coll_id, $table, $values_form ) { if(empty($values_form) || count($arr_id) < 1) return false; require_once('modules/notes/class/notes_controler.php'); $note = new notes_controler(); $coll_id = $_SESSION['current_basket']['coll_id']; $res_id = $arr_id[0]; $formValues = []; for($i = 0; $i < count($values_form); $i++) { $id = $values_form[$i]['ID']; $formValues[$id] = $values_form[$i]['VALUE']; } # save note if($formValues['note_content_to_users'] != ''){ //Add notes $note->addNote($res_id, $coll_id, $formValues['note_content_to_users']); } return array('result' => $res_id.'#', 'history_msg' => ''); } function manage_empty_error($arr_id, $history, $id_action, $label_action, $status) { $db = new Database(); $_SESSION['action_error'] = ''; $res_id = $arr_id[0]; $db->query('UPDATE listinstance SET process_date = NULL WHERE res_id = ? AND difflist_type = ?', [$res_id, 'VISA_CIRCUIT']); return array('result' => $res_id.'#', 'history_msg' => $label_action); }