diff --git a/apps/maarch_entreprise/actions/close_mail_and_index.php b/apps/maarch_entreprise/actions/close_mail_and_index.php index 6015d49d77a93d32ca4068b71c20d8b0dd3280de..badb9909b4e1b3516af9e1da4ce9d269beb6c627 100755 --- a/apps/maarch_entreprise/actions/close_mail_and_index.php +++ b/apps/maarch_entreprise/actions/close_mail_and_index.php @@ -50,11 +50,10 @@ function manage_close($arr_id, $history, $id_action, $label_action, $status) $db = new Database(); $ind_coll = $sec->get_ind_collection($_POST['coll_id']); - $ext_table = $_SESSION['collections'][$ind_coll]['extensions'][0]; for ($i=0; $i<count($arr_id); $i++) { $result .= $arr_id[$i].'#'; - $db->query("UPDATE ".$ext_table. " SET closing_date = CURRENT_TIMESTAMP WHERE res_id = ?", array($arr_id[$i])); + $db->query("UPDATE res_letterbox SET closing_date = CURRENT_TIMESTAMP WHERE res_id = ?", array($arr_id[$i])); } $_SESSION['indexing']['category_id'] = 'outgoing'; return array( diff --git a/apps/maarch_entreprise/actions/close_mail_with_attachment.php b/apps/maarch_entreprise/actions/close_mail_with_attachment.php index 913235bbd34bbe42de3e379aae9a7f8ffe1feb4c..38d46680775383721931e033d1bd287ddd2f6955 100755 --- a/apps/maarch_entreprise/actions/close_mail_with_attachment.php +++ b/apps/maarch_entreprise/actions/close_mail_with_attachment.php @@ -67,10 +67,9 @@ function manage_close($arr_id, $history, $id_action, $label_action, $status) $db = new Database(); $ind_coll = $sec->get_ind_collection($_POST['coll_id']); - $ext_table = $_SESSION['collections'][$ind_coll]['extensions'][0]; for ($i=0; $i<count($arr_id); $i++) { $result .= $arr_id[$i].'#'; - $db->query("UPDATE ".$ext_table. " SET closing_date = CURRENT_TIMESTAMP WHERE res_id = ?", array($arr_id[$i])); + $db->query("UPDATE res_letterbox SET closing_date = CURRENT_TIMESTAMP WHERE res_id = ?", array($arr_id[$i])); } return array('result' => $result, 'history_msg' => ''); } diff --git a/apps/maarch_entreprise/actions/mark_as_read.php b/apps/maarch_entreprise/actions/mark_as_read.php index f746aa55b461f2611e0fd0f475d0e23e093dd004..c5eb4c5386a942c49fcc9ab43947c80824b5f7a2 100755 --- a/apps/maarch_entreprise/actions/mark_as_read.php +++ b/apps/maarch_entreprise/actions/mark_as_read.php @@ -38,7 +38,6 @@ function manage_markAsRead($arr_id, $history, $id_action, $label_action, $status $sec = new security(); $ind_coll = $sec->get_ind_collection($_POST['coll_id']); - $ext_table = $_SESSION['collections'][$ind_coll]['extensions'][0]; for ($i=0; $i<count($arr_id);$i++) { $result .= $arr_id[$i].'#'; diff --git a/apps/maarch_entreprise/actions/set_persistent_mode_off.php b/apps/maarch_entreprise/actions/set_persistent_mode_off.php index fec3b08a82363ffc0ebfa13cb360098727e16237..9ffbe4d8151822bc192c5aba5e5e2544a1c2aa6a 100755 --- a/apps/maarch_entreprise/actions/set_persistent_mode_off.php +++ b/apps/maarch_entreprise/actions/set_persistent_mode_off.php @@ -50,7 +50,6 @@ function manage_persistentOff($arr_id, $history, $id_action, $label_action, $sta $sec = new security(); $ind_coll = $sec->get_ind_collection($_POST['coll_id']); - $ext_table = $_SESSION['collections'][$ind_coll]['extensions'][0]; for($i=0; $i<count($arr_id );$i++) { diff --git a/apps/maarch_entreprise/actions/set_persistent_mode_on.php b/apps/maarch_entreprise/actions/set_persistent_mode_on.php index 0b73290fe43fde9d979497ff50cc0a2fdeffbca8..616f3f4633adcbe4b44325a3d41eeed522f7d15d 100755 --- a/apps/maarch_entreprise/actions/set_persistent_mode_on.php +++ b/apps/maarch_entreprise/actions/set_persistent_mode_on.php @@ -50,7 +50,6 @@ function manage_persistentOn($arr_id, $history, $id_action, $label_action, $stat $sec = new security(); $ind_coll = $sec->get_ind_collection($_POST['coll_id']); - $ext_table = $_SESSION['collections'][$ind_coll]['extensions'][0]; for($i=0; $i<count($arr_id );$i++) { diff --git a/apps/maarch_entreprise/actions/validate_mail.php b/apps/maarch_entreprise/actions/validate_mail.php index adf595f4126d2f81f321eb59cbb092dbd2876dce..add7d213b1f654cc2009324bd2ed613e6db7a10f 100755 --- a/apps/maarch_entreprise/actions/validate_mail.php +++ b/apps/maarch_entreprise/actions/validate_mail.php @@ -50,10 +50,8 @@ function check_category($coll_id, $res_id) $res = $stmt->fetchObject(); if (!isset($res->category_id)) { - $ind_coll = $sec->get_ind_collection($coll_id); - $table_ext = $_SESSION['collections'][$ind_coll]['extensions'][0]; - $db->query('INSERT INTO '.$table_ext.' (res_id, category_id) VALUES (?, ?)', - array($res_id, $_SESSION['coll_categories']['letterbox_coll']['default_category'])); + $db->query('UPDATE res_letterbox SET category_id = ? WHERE res_id = ?', + array('incoming', $res_id)); } } @@ -406,19 +404,6 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module, .'index.php?display=true&dir=indexing_searching&page=change_category_actions' .'&resId='.$res_id.'&collId='.$coll_id.'\',\''.$res_id.'\',\''.$coll_id.'\',this.options[this.selectedIndex].value);">'; $frm_str .= '<option value="">'._CHOOSE_CATEGORY.'</option>'; - foreach (array_keys($_SESSION['coll_categories']['letterbox_coll']) as $cat_id) { - if ($cat_id != 'default_category') { - $frm_str .= '<option value="'.functions::xssafe($cat_id).'"'; - if ( - (isset($data['category_id']['value']) && $data['category_id']['value'] == $cat_id) - || $_SESSION['coll_categories']['letterbox_coll']['default_category'] == $cat_id - || $_SESSION['indexing']['category_id'] == $cat_id - ) { - $frm_str .= 'selected="selected"'; - } - $frm_str .= '>'.functions::xssafe($_SESSION['coll_categories']['letterbox_coll'][$cat_id]).'</option>'; - } - } $frm_str .= '</select></td>'; $frm_str .= '<td><span class="red_asterisk" id="category_id_mandatory" style="display:inline;vertical-align:text-top"><i class="fa fa-star"></i></span></td>'; $frm_str .= '</tr>'; @@ -1685,7 +1670,7 @@ function manage_form($arr_id, $history, $id_action, $label_action, $status, $col $table = $sec->retrieve_table_from_coll($coll_id); $ind_coll = $sec->get_ind_collection($coll_id); $cat_id = get_value_fields($values_form, 'category_id'); - $table_ext = $_SESSION['collections'][$ind_coll]['extensions'][0]; + $table_ext = 'res_letterbox'; $res_id = $arr_id[0]; $status_id = get_value_fields($values_form, 'status'); $type_id = get_value_fields($values_form, 'type_id'); diff --git a/apps/maarch_entreprise/admin/contacts/ajaxDeleteContact.php b/apps/maarch_entreprise/admin/contacts/ajaxDeleteContact.php index b60d1100663dba8f886cb9ba926ebea2359d28b8..6851d457903bf729d0a45a1e943f6cb25e6fd5ff 100755 --- a/apps/maarch_entreprise/admin/contacts/ajaxDeleteContact.php +++ b/apps/maarch_entreprise/admin/contacts/ajaxDeleteContact.php @@ -18,9 +18,9 @@ if (isset($_REQUEST['contactId'])) { && $_REQUEST['replacedAddressId'] <> 'false' && $_REQUEST['replacedAddressId'] <> '' ) { - $replaceQueryExpContact = "UPDATE mlb_coll_ext SET exp_contact_id = ?, address_id = ? WHERE exp_contact_id = ?"; + $replaceQueryExpContact = "UPDATE res_letterbox SET exp_contact_id = ?, address_id = ? WHERE exp_contact_id = ?"; $db->query($replaceQueryExpContact, array($_REQUEST['replacedContactId'], $_REQUEST['replacedAddressId'], $_REQUEST['contactId'])); - $replaceQueryDestContact = "UPDATE mlb_coll_ext SET dest_contact_id = ?, address_id = ? WHERE dest_contact_id = ?"; + $replaceQueryDestContact = "UPDATE res_letterbox SET dest_contact_id = ?, address_id = ? WHERE dest_contact_id = ?"; $db->query($replaceQueryDestContact, array($_REQUEST['replacedContactId'], $_REQUEST['replacedAddressId'], $_REQUEST['contactId'])); $db->query("UPDATE contacts_res SET contact_id = ?, address_id = ? WHERE contact_id = ?", array($_REQUEST['replacedContactId'], $_REQUEST['replacedAddressId'], $_REQUEST['contactId'])); diff --git a/apps/maarch_entreprise/admin/contacts/contact_addresses/contact_addresses_del.php b/apps/maarch_entreprise/admin/contacts/contact_addresses/contact_addresses_del.php index 018e7f4a4d1979501fda23e0720e115a71fa4426..b4524dfedf7bac4df58cf0520bab3ed452d74240 100755 --- a/apps/maarch_entreprise/admin/contacts/contact_addresses/contact_addresses_del.php +++ b/apps/maarch_entreprise/admin/contacts/contact_addresses/contact_addresses_del.php @@ -94,17 +94,17 @@ if ($_REQUEST['valid']) { // delete contact types $db->query("DELETE FROM ".$_SESSION['tablename']['contact_addresses']." WHERE id = ?", array($id)); - $stmt = $db->query("SELECT res_id, exp_contact_id, dest_contact_id FROM mlb_coll_ext WHERE address_id = ?", array($id)); + $stmt = $db->query("SELECT res_id, exp_contact_id, dest_contact_id FROM res_letterbox WHERE address_id = ?", array($id)); while ($res = $stmt->fetchObject()) { if ($res->exp_contact_id <> "") { - $db->query("UPDATE mlb_coll_ext SET exp_contact_id = ? WHERE res_id = ?", array($new_contact_id, $res->res_id)); + $db->query("UPDATE res_letterbox SET exp_contact_id = ? WHERE res_id = ?", array($new_contact_id, $res->res_id)); } else { - $db->query("UPDATE mlb_coll_ext SET dest_contact_id = ? WHERE res_id = ?", array($new_contact_id, $res->res_id)); + $db->query("UPDATE res_letterbox SET dest_contact_id = ? WHERE res_id = ?", array($new_contact_id, $res->res_id)); } } - $db->query("UPDATE mlb_coll_ext SET address_id = ? WHERE address_id = ?", array($newid, $id)); + $db->query("UPDATE res_letterbox SET address_id = ? WHERE address_id = ?", array($newid, $id)); $db->query("UPDATE contacts_res SET contact_id = ?, address_id = ? WHERE address_id = ?", array($new_contact_id, $newid, $id)); $db->query("UPDATE resource_contacts SET item_id = ? WHERE item_id = ?", array($newid, $id)); @@ -133,13 +133,13 @@ if ($_REQUEST['valid']) { $db->query("UPDATE contact_addresses set contact_id = ? WHERE id = ?", array($_POST['new_contact_id_reaffect'], $id)); $db->query("UPDATE contacts_res set contact_id = ? WHERE address_id = ?", array($_POST['new_contact_id_reaffect'], $id)); - $stmt = $db->query("SELECT res_id, exp_contact_id, dest_contact_id FROM mlb_coll_ext WHERE address_id = ?", array($id)); + $stmt = $db->query("SELECT res_id, exp_contact_id, dest_contact_id FROM res_letterbox WHERE address_id = ?", array($id)); while ($res = $stmt->fetchObject()) { if ($res->exp_contact_id <> "") { - $db->query("UPDATE mlb_coll_ext SET exp_contact_id = ? WHERE res_id = ?", array($_POST['new_contact_id_reaffect'], $res->res_id)); + $db->query("UPDATE res_letterbox SET exp_contact_id = ? WHERE res_id = ?", array($_POST['new_contact_id_reaffect'], $res->res_id)); } else { - $db->query("UPDATE mlb_coll_ext SET dest_contact_id = ? WHERE res_id = ?", array($_POST['new_contact_id_reaffect'], $res->res_id)); + $db->query("UPDATE res_letterbox SET dest_contact_id = ? WHERE res_id = ?", array($_POST['new_contact_id_reaffect'], $res->res_id)); } } diff --git a/apps/maarch_entreprise/admin/contacts/contacts_v2/contacts_v2_del.php b/apps/maarch_entreprise/admin/contacts/contacts_v2/contacts_v2_del.php index d6e66e65593babf759d3a8b93083fe9b2d56b357..dd8d1caab7192d8197d64d64b5d8207bb442db96 100755 --- a/apps/maarch_entreprise/admin/contacts/contacts_v2/contacts_v2_del.php +++ b/apps/maarch_entreprise/admin/contacts/contacts_v2/contacts_v2_del.php @@ -72,10 +72,8 @@ if(isset($_REQUEST['valid'])) $new_address = $_REQUEST['address']; $i=0; - $db->query("UPDATE ".$_SESSION['collections'][$i]['extensions'][$i] - . " SET exp_contact_id = ?, address_id = ? WHERE exp_contact_id = ?", array($new_contact, $new_address, $s_id)); - $db->query("UPDATE ".$_SESSION['collections'][$i]['extensions'][$i] - . " SET dest_contact_id = ?, address_id = ? WHERE dest_contact_id = ?", array($new_contact, $new_address, $s_id)); + $db->query("UPDATE res_letterbox SET exp_contact_id = ?, address_id = ? WHERE exp_contact_id = ?", array($new_contact, $new_address, $s_id)); + $db->query("UPDATE res_letterbox SET dest_contact_id = ?, address_id = ? WHERE dest_contact_id = ?", array($new_contact, $new_address, $s_id)); $db->query("UPDATE contacts_res SET contact_id = ?, address_id = ? WHERE contact_id = ?", array($new_contact, $new_address, $s_id)); $aAddressesTmp = \SrcCore\models\DatabaseModel::select([ diff --git a/apps/maarch_entreprise/admin/contacts/fusionContact.php b/apps/maarch_entreprise/admin/contacts/fusionContact.php index 43d52baa78d5696064b9d33eb20ba535835bed53..6ee27727f82c6507a35da2a548395b875ceec5d3 100755 --- a/apps/maarch_entreprise/admin/contacts/fusionContact.php +++ b/apps/maarch_entreprise/admin/contacts/fusionContact.php @@ -16,12 +16,12 @@ $del_address_id = explode(',', $_POST['del_address_id']); foreach ($contacts_id as $key => $value) { //mise à jour des contacts courriers de type arrivé - $query = "UPDATE mlb_coll_ext SET dest_contact_id = ? WHERE dest_contact_id = ?"; + $query = "UPDATE res_letterbox SET dest_contact_id = ? WHERE dest_contact_id = ?"; $arrayPDO = array($master_contact_id,$value); $db->query($query, $arrayPDO); //mise à jour des contacts courriers de type départ - $query = "UPDATE mlb_coll_ext SET exp_contact_id = ? WHERE exp_contact_id = ?"; + $query = "UPDATE res_letterbox SET exp_contact_id = ? WHERE exp_contact_id = ?"; $arrayPDO = array($master_contact_id,$value); $db->query($query, $arrayPDO); @@ -49,7 +49,7 @@ foreach ($contacts_id as $key => $value) { foreach ($del_address_id as $key => $value) { if (!empty($value)) { //mise à jour des adresses courriers de type arrivé - $query = "UPDATE mlb_coll_ext SET address_id = ? WHERE address_id = ?"; + $query = "UPDATE res_letterbox SET address_id = ? WHERE address_id = ?"; $arrayPDO = array($master_address_id,$value); $db->query($query, $arrayPDO); diff --git a/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php b/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php index 4ea3bbb9d927d74e0ab026ec267c1d7d28bf20da..76674fd47df2652f2ded2ff2c86faf7e9d7c1cd6 100755 --- a/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php +++ b/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php @@ -152,20 +152,8 @@ abstract class business_app_tools_Abstract extends Database if (!empty($tmp) && defined($tmp) && constant($tmp) <> NULL) { $tmp = constant($tmp); } - $extensions = $col->extensions; $collId = (string) $col->id; - $tab = array(); - if ($extensions->count()) { - $extensionTables = $extensions->table; - if ($extensionTables->count() > 0) { - foreach ($extensions->table as $table) { - if (strlen($extensionTables) > 0) { - array_push($tab, (string) $table); - } - } - } - } if (isset($col->table) && ! empty($col->table)) { $_SESSION['collections'][$i] = array( 'id' => (string) $col->id, @@ -179,7 +167,6 @@ abstract class business_app_tools_Abstract extends Database 'script_search' => (string) $col->script_search, 'script_search_result' => (string) $col->script_search_result, 'script_details' => (string) $col->script_details, - 'extensions' => $tab, ); $_SESSION['coll_categories']['letterbox_coll'] = [ @@ -201,7 +188,6 @@ abstract class business_app_tools_Abstract extends Database 'script_search' => (string) $col->script_search, 'script_search_result' => (string) $col->script_search_result, 'script_details' => (string) $col->script_details, - 'extensions' => $tab, ); } } diff --git a/apps/maarch_entreprise/class/class_contacts_v2_Abstract.php b/apps/maarch_entreprise/class/class_contacts_v2_Abstract.php index 871201b55cda25a1022cb6c7cee6527d26f92015..6baace7b671b7701a67e4085438d39840c693c8f 100755 --- a/apps/maarch_entreprise/class/class_contacts_v2_Abstract.php +++ b/apps/maarch_entreprise/class/class_contacts_v2_Abstract.php @@ -2786,7 +2786,7 @@ abstract class contacts_v2_Abstract extends Database if ($mode == 'contact_address') { $aRes = []; - $stmt = $db->query("SELECT mlb.res_id FROM mlb_coll_ext mlb LEFT JOIN res_letterbox rl ON rl.res_id = mlb.res_id WHERE rl.status <> 'DEL' AND mlb.address_id = ?", array($id)); + $stmt = $db->query("SELECT res_id FROM res_letterbox WHERE status <> 'DEL' AND address_id = ?", array($id)); while($object = $stmt->fetchObject()){ $aRes[$object->res_id] = $object->res_id; } diff --git a/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php b/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php index 1febb45b7e0a0b9c0961d007636f7804b0b93fa7..cca5a43d9b0526f6f9e666145f2a8c9668ec2b37 100755 --- a/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php +++ b/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php @@ -126,7 +126,6 @@ abstract class indexing_searching_app_Abstract extends Database $func = new functions(); $sec = new security(); $data_res = array(); - $data_ext = array(); $request = new request(); $core = new core_tools(); $db = new Database(); @@ -134,7 +133,6 @@ abstract class indexing_searching_app_Abstract extends Database $table = $sec->retrieve_table_from_coll($coll_id); $view = $sec->retrieve_view_from_coll_id($coll_id); $ind_coll = $sec->get_ind_collection($coll_id); - $table_ext = $_SESSION['collections'][$ind_coll]['extensions'][0]; if (!$table) { $_SESSION['error'] .= _COLL_HAS_NO_TABLE; } @@ -176,11 +174,11 @@ abstract class indexing_searching_app_Abstract extends Database if (!empty($post['contact'])) { $catContact = explode('_', $post['contact_type']); if (is_numeric($post[$key])) { - array_push($data_ext, array('column' => $catContact[0].'_contact_id', 'value' => $post[$key], 'type' => 'string')); - array_push($data_ext, array('column' => $catContact[0].'_user_id', 'value' => null, 'type' => 'string')); + array_push($data_res, array('column' => $catContact[0].'_contact_id', 'value' => $post[$key], 'type' => 'string')); + array_push($data_res, array('column' => $catContact[0].'_user_id', 'value' => null, 'type' => 'string')); } else { - array_push($data_ext, array('column' => $catContact[0].'_user_id', 'value' => $post[$key], 'type' => 'string')); - array_push($data_ext, array('column' => $catContact[0].'_contact_id', 'value' => null, 'type' => 'string')); + array_push($data_res, array('column' => $catContact[0].'_user_id', 'value' => $post[$key], 'type' => 'string')); + array_push($data_res, array('column' => $catContact[0].'_contact_id', 'value' => null, 'type' => 'string')); } } else { $_SESSION['error'] .= $_ENV['categories'][$cat_id]['other_cases']['contact']['label'].' '._IS_EMPTY; @@ -190,7 +188,7 @@ abstract class indexing_searching_app_Abstract extends Database if (empty(trim($post[$key]))) { $post[$key] = null; } - array_push($data_ext, array('column' => 'address_id', 'value' => $post[$key], 'type' => 'string')); + array_push($data_res, array('column' => 'address_id', 'value' => $post[$key], 'type' => 'string')); } } if ($_ENV['categories'][$cat_id][$key]['modify'] == true) { @@ -208,7 +206,7 @@ abstract class indexing_searching_app_Abstract extends Database if ($_ENV['categories'][$cat_id][$key]['table'] == 'res') { array_push($data_res, array('column' => $key, 'value' => $func->format_date_db($post[$key]), 'type' => 'date')); } elseif ($_ENV['categories'][$cat_id][$key]['table'] == 'coll_ext') { - array_push($data_ext, array('column' => $key, 'value' => $func->format_date_db($post[$key]), 'type' => 'date')); + array_push($data_res, array('column' => $key, 'value' => $func->format_date_db($post[$key]), 'type' => 'date')); } } if ($_ENV['categories'][$cat_id][$key]['type_form'] == 'integer' && preg_match('/^[0-9]+$/', $post[$key]) == 0) { @@ -217,7 +215,7 @@ abstract class indexing_searching_app_Abstract extends Database if ($_ENV['categories'][$cat_id][$key]['table'] == 'res') { array_push($data_res, array('column' => $key, 'value' => $post[$key], 'type' => 'integer')); } elseif ($_ENV['categories'][$cat_id][$key]['table'] == 'coll_ext') { - array_push($data_ext, array('column' => $key, 'value' => $post[$key], 'type' => 'integer')); + array_push($data_res, array('column' => $key, 'value' => $post[$key], 'type' => 'integer')); } } if ($_ENV['categories'][$cat_id][$key]['type_form'] == 'radio' && !empty($post[$key]) && !in_array($post[$key], $_ENV['categories'][$cat_id][$key]['values'])) { @@ -227,7 +225,7 @@ abstract class indexing_searching_app_Abstract extends Database if ($_ENV['categories'][$cat_id][$key]['table'] == 'res') { array_push($data_res, array('column' => $key, 'value' => $post[$key], 'type' => 'string')); } elseif ($_ENV['categories'][$cat_id][$key]['table'] == 'coll_ext') { - array_push($data_ext, array('column' => $key, 'value' => $post[$key], 'type' => 'string')); + array_push($data_res, array('column' => $key, 'value' => $post[$key], 'type' => 'string')); } } } @@ -261,7 +259,7 @@ abstract class indexing_searching_app_Abstract extends Database $processLimitDate = (array) $processLimitDate; array_push( - $data_ext, + $data_res, array( 'column' => 'process_limit_date', 'value' => $func->format_date_db($processLimitDate['date'], 'true', '', 'true'), @@ -270,7 +268,7 @@ abstract class indexing_searching_app_Abstract extends Database ); } else { array_push( - $data_ext, + $data_res, array( 'column' => 'process_limit_date', 'value' => null, @@ -313,9 +311,6 @@ abstract class indexing_searching_app_Abstract extends Database //$request->show_array($data_res); //exit(); $request->PDOupdate($table, $data_res, $where, $arrayPDO, $_SESSION['config']['databasetype']); - if (count($data_ext) > 0) { - $request->PDOupdate($table_ext, $data_ext, $where, $arrayPDO, $_SESSION['config']['databasetype']); - } $_SESSION['info'] = _INDEX_UPDATED.' ('.strtolower(_NUM).$id_to_update.')'; //$hist->add($table, $id_to_update, "UP", $_SESSION['error'], $_SESSION['config']['databasetype'],'apps'); diff --git a/apps/maarch_entreprise/class/class_lists_Abstract.php b/apps/maarch_entreprise/class/class_lists_Abstract.php index 9a2ef0438b4866996d88fc888ef681c5c4166307..eaa4646731292e072522e68f6f9f639c3a4b4c6a 100755 --- a/apps/maarch_entreprise/class/class_lists_Abstract.php +++ b/apps/maarch_entreprise/class/class_lists_Abstract.php @@ -304,16 +304,14 @@ abstract class lists_Abstract extends Database .$this->divListId.'\', '.$this->modeReturn.');">'; $filters .= '<option value="none" style="text-align:center;"></option>'; foreach (array_keys($_SESSION['coll_categories'][$this->collId]) as $catId) { - if ($catId != 'default_category') { - if (isset($_SESSION['filters']['category']['VALUE']) - && $_SESSION['filters']['category']['VALUE'] == $catId - ) { - $selected = 'selected="selected"'; - } else { - $selected = ''; - } - $filters .= '<option value="'.$catId.'" '.$selected.'>'.$_SESSION['coll_categories'][$this->collId][$catId].'</option>'; + if (isset($_SESSION['filters']['category']['VALUE']) + && $_SESSION['filters']['category']['VALUE'] == $catId + ) { + $selected = 'selected="selected"'; + } else { + $selected = ''; } + $filters .= '<option value="'.$catId.'" '.$selected.'>'.$_SESSION['coll_categories'][$this->collId][$catId].'</option>'; } $filters .= '</select> '; $filters .= '<script> $j("#category_id_list").chosen({width:"150px",allow_single_deselect: true});</script>'; diff --git a/apps/maarch_entreprise/definition_mail_categories.php b/apps/maarch_entreprise/definition_mail_categories.php index f41b974e081312c97dd3c6beba0e5458a4c8dffd..5651ea6b28fae134a611c26e378c16ed4c24ca1c 100755 --- a/apps/maarch_entreprise/definition_mail_categories.php +++ b/apps/maarch_entreprise/definition_mail_categories.php @@ -137,16 +137,16 @@ $_ENV['categories']['incoming']['departure_date'] = array ( 'modify' => true, 'form_show' => 'date' ); -$_ENV['categories']['incoming']['nature_id'] = array( - 'type_form' => 'string', - 'type_field' => 'string', - 'mandatory' => true, - 'label' => _NATURE, - 'table' => 'coll_ext', - 'img' => 'envelope', - 'modify' => false, //DO NOT MODIFY ! - 'form_show' => 'select', -); +// $_ENV['categories']['incoming']['nature_id'] = array( +// 'type_form' => 'string', +// 'type_field' => 'string', +// 'mandatory' => true, +// 'label' => _NATURE, +// 'table' => 'coll_ext', +// 'img' => 'envelope', +// 'modify' => false, //DO NOT MODIFY ! +// 'form_show' => 'select', +// ); $_ENV['categories']['incoming']['reference_number'] = array( 'type_form' => 'string', 'type_field' => 'string', @@ -309,16 +309,16 @@ $_ENV['categories']['outgoing']['departure_date'] = array ( 'modify' => true, 'form_show' => 'date' ); -$_ENV['categories']['outgoing']['nature_id'] = array( - 'type_form' => 'string', - 'type_field' => 'string', - 'mandatory' => true, - 'label' => _NATURE, - 'table' => 'coll_ext', - 'img' => 'envelope', - 'modify' => false, //DO NOT MODIFY ! - 'form_show' => 'select', -); +// $_ENV['categories']['outgoing']['nature_id'] = array( +// 'type_form' => 'string', +// 'type_field' => 'string', +// 'mandatory' => true, +// 'label' => _NATURE, +// 'table' => 'coll_ext', +// 'img' => 'envelope', +// 'modify' => false, //DO NOT MODIFY ! +// 'form_show' => 'select', +// ); $_ENV['categories']['outgoing']['reference_number'] = array( 'type_form' => 'string', 'type_field' => 'string', @@ -472,16 +472,16 @@ $_ENV['categories']['internal']['doc_date'] = array( 'modify' => true, 'form_show' => 'date', ); -$_ENV['categories']['internal']['nature_id'] = array( - 'type_form' => 'string', - 'type_field' => 'string', - 'mandatory' => true, - 'label' => _NATURE, - 'table' => 'coll_ext', - 'img' => 'envelope', - 'modify' => false, //DO NOT MODIFY ! - 'form_show' => 'select', -); +// $_ENV['categories']['internal']['nature_id'] = array( +// 'type_form' => 'string', +// 'type_field' => 'string', +// 'mandatory' => true, +// 'label' => _NATURE, +// 'table' => 'coll_ext', +// 'img' => 'envelope', +// 'modify' => false, //DO NOT MODIFY ! +// 'form_show' => 'select', +// ); $_ENV['categories']['internal']['reference_number'] = array( 'type_form' => 'string', 'type_field' => 'string', @@ -1165,7 +1165,7 @@ function get_general_data($coll_id, $res_id, $mode, $params = array()) } } elseif ($arr[$i] == 'dest_contact_id' || $arr[$i] == 'exp_contact_id') { if (!empty($line->{$arr[$i]})) { - $stmt2 = $db->query('SELECT address_id FROM mlb_coll_ext WHERE res_id = ?', array($res_id)); + $stmt2 = $db->query('SELECT address_id FROM res_letterbox WHERE res_id = ?', array($res_id)); $resAddress = $stmt2->fetchObject(); $addressId = $resAddress->address_id; $data[$arr[$i]]['address_value'] = $addressId; @@ -1309,7 +1309,7 @@ function get_general_data($coll_id, $res_id, $mode, $params = array()) } elseif ($arr[$i] == 'dest_contact_id' || $arr[$i] == 'exp_contact_id') { if (!empty($line->{$arr[$i]})) { $data['type_contact'] = 'external'; - $stmt2 = $db->query('SELECT address_id FROM mlb_coll_ext WHERE res_id = ?', array($res_id)); + $stmt2 = $db->query('SELECT address_id FROM res_letterbox WHERE res_id = ?', array($res_id)); $resAddress = $stmt2->fetchObject(); $addressId = $resAddress->address_id; $stmt2 = $db->query('SELECT is_corporate_person, is_private, contact_lastname, contact_firstname, society, society_short, contact_purpose_id, address_num, address_street, address_postal_code, address_town, lastname, firstname FROM view_contacts WHERE contact_id = ? and ca_id = ?', array($line->{$arr[$i]}, $addressId)); diff --git a/apps/maarch_entreprise/indexing_searching/details.php b/apps/maarch_entreprise/indexing_searching/details.php index a41e4f3e7e54791d2e06d33842e4b5c09fd3fa0c..70236483b3b9ab4461f540bd6370733f3db7da28 100755 --- a/apps/maarch_entreprise/indexing_searching/details.php +++ b/apps/maarch_entreprise/indexing_searching/details.php @@ -135,14 +135,6 @@ if (isset($_GET['id']) && !empty($_GET['id'])) { $s_id = addslashes($func->wash($_GET['id'], 'num', _THE_DOC)); } -//CHECK IF DATAS IN MLB_COLL_EXT -$stmt = $db->query('SELECT res_id FROM mlb_coll_ext WHERE res_id = ?', array($s_id)); -if ($stmt->rowCount() <= 0) { - $_SESSION['error'] = _QUALIFY_FIRST; - echo "<script language=\"javascript\" type=\"text/javascript\">window.top.location.href='index.php';</script>"; - exit(); -} - $_SESSION['doc_id'] = $s_id; $user = \User\models\UserModel::getByLogin(['login' => $_SESSION['user']['UserId'], 'select' => ['id']]); $right = \Resource\controllers\ResController::hasRightByResId(['resId' => [$s_id], 'userId' => $user['id']]); diff --git a/apps/maarch_entreprise/indexing_searching/watermark.php b/apps/maarch_entreprise/indexing_searching/watermark.php index ff0623b544231942343e9f1f8e67acefd0e61bc1..b8eb8c3fd98a1d9ac252a422a12ead3c413ff489 100755 --- a/apps/maarch_entreprise/indexing_searching/watermark.php +++ b/apps/maarch_entreprise/indexing_searching/watermark.php @@ -67,7 +67,7 @@ if ($watermarkTab['text'] == '') { $dbView = new Database(); $query = " select " . $matches[1][$z] - . " as thecolumn from mlb_coll_ext where res_id = ?"; + . " as thecolumn from res_letterbox where res_id = ?"; $stmt = $dbView->query($query, array($res_id)); $returnQuery = $stmt->fetchObject(); $currentText = $returnQuery->thecolumn; diff --git a/apps/maarch_entreprise/lang/en.php b/apps/maarch_entreprise/lang/en.php index 44d8636b38da5694f121093e00408ee91f69aec1..8f2ae96480e25250bda0fc64e86d288d0c36a4cf 100755 --- a/apps/maarch_entreprise/lang/en.php +++ b/apps/maarch_entreprise/lang/en.php @@ -2996,7 +2996,7 @@ if (!defined('_CLOSE_MAIL')) { } if (!defined('_CLOSE_MAIL_DESC')) { - define('_CLOSE_MAIL_DESC', "Allows you to update the closing date of a document (\'closing_date\' of the mlb_coll_ext table). ESSENTIAL in order to complete your document workflow.'"); + define('_CLOSE_MAIL_DESC', "Allows you to update the closing date of a document (\'closing_date\' of the res_letterbox table). ESSENTIAL in order to complete your document workflow.'"); } /******************** Keywords Helper ************/ @@ -4074,7 +4074,7 @@ if (!defined('_CLOSE_MAIL_AND_INDEX')) { } if (!defined('_CLOSE_MAIL_AND_INDEX_DESC')) { - define('_CLOSE_MAIL_AND_INDEX_DESC', "Allows you to update the closing date of a mail ('closing_date' in the mlb_coll_ext table) AND opens the index page to save a new mail."); + define('_CLOSE_MAIL_AND_INDEX_DESC', "Allows you to update the closing date of a mail ('closing_date' in the res_letterbox table) AND opens the index page to save a new mail."); } if (!defined('_DOC_NOT_CLOSED')) { diff --git a/apps/maarch_entreprise/lang/fr.php b/apps/maarch_entreprise/lang/fr.php index 0736f8752fb58460000e36423161b4616ac72b39..7b1fd38daaf80f9554eaac9876730df2b9ca01dd 100755 --- a/apps/maarch_entreprise/lang/fr.php +++ b/apps/maarch_entreprise/lang/fr.php @@ -1526,7 +1526,7 @@ if (!defined('_CLOSE_MAIL_WITH_ATTACHMENT')) { define('_CLOSE_MAIL_WITH_ATTACHMENT', 'Clôturer un courrier avec pièce jointe'); } // if (!defined('_CLOSE_MAIL_WITH_ATTACHMENT_DESC')) { -// define('_CLOSE_MAIL_WITH_ATTACHMENT_DESC', "Permet de mettre à jour la date de clôture d'un courrier ('closing_date' de la table mlb_coll_ext) avec présence OBLIGATOIRE de pièce(s) jointe(s) / annotation(s)."); +// define('_CLOSE_MAIL_WITH_ATTACHMENT_DESC', "Permet de mettre à jour la date de clôture d'un courrier ('closing_date' de la table res_letterbox) avec présence OBLIGATOIRE de pièce(s) jointe(s) / annotation(s)."); // } if (!defined('_ACTION_NOT_IN_DB')) { define('_ACTION_NOT_IN_DB', 'Action non enregistrée en base'); @@ -3026,7 +3026,7 @@ if (!defined('_CLOSE_MAIL')) { define('_CLOSE_MAIL', 'Clôturer un courrier'); } if (!defined('_CLOSE_MAIL_DESC')) { - define('_CLOSE_MAIL_DESC', "Permet de mettre à jour la date de clôture d'un courrier ('closing_date' de la table mlb_coll_ext). ESSENTIEL afin de terminer votre workflow de courrier."); + define('_CLOSE_MAIL_DESC', "Permet de mettre à jour la date de clôture d'un courrier ('closing_date' de la table res_letterbox). ESSENTIEL afin de terminer votre workflow de courrier."); } /******************** Keywords Helper ************/ @@ -4111,7 +4111,7 @@ if (!defined('_CLOSE_MAIL_AND_INDEX')) { define('_CLOSE_MAIL_AND_INDEX', "Clôturer un courrier et lancer l'indexation"); } if (!defined('_CLOSE_MAIL_AND_INDEX_DESC')) { - define('_CLOSE_MAIL_AND_INDEX_DESC', "Permet de mettre à jour la date de clôture d'un courrier ('closing_date' de la table mlb_coll_ext) ET ouvre la page d'indexation afin d'enregistrer un nouveau courrier."); + define('_CLOSE_MAIL_AND_INDEX_DESC', "Permet de mettre à jour la date de clôture d'un courrier ('closing_date' de la table res_letterbox) ET ouvre la page d'indexation afin d'enregistrer un nouveau courrier."); } if (!defined('_DOC_NOT_CLOSED')) { define('_DOC_NOT_CLOSED', "Ce courrier n'est pas clôturé"); diff --git a/apps/maarch_entreprise/lang/nl.php b/apps/maarch_entreprise/lang/nl.php index 2f21e738f66d47f0b00dde907bddccf928d99c48..03197fbe6bd9db71c45ed861b244dd0ad8d31ef5 100755 --- a/apps/maarch_entreprise/lang/nl.php +++ b/apps/maarch_entreprise/lang/nl.php @@ -482,7 +482,7 @@ if (!defined('_AJAX_PARAM_ERROR')) { define('_AJAX_PARAM_ERROR', 'Fout overgang if (!defined('_ACTION_CONFIRM')) { define('_ACTION_CONFIRM', 'Wilt u de volgende actie uitvoeren:');} if (!defined('_ADD_ATTACHMENT_OR_NOTE')) { define('_ADD_ATTACHMENT_OR_NOTE', 'Voeg een bijlage of een nota toe voor deze brief/brieven');} if (!defined('_CLOSE_MAIL_WITH_ATTACHMENT')) { define('_CLOSE_MAIL_WITH_ATTACHMENT', 'Een brief met een bijlage afsluiten');} -//if (!defined('_CLOSE_MAIL_WITH_ATTACHMENT_DESC')) { define('_CLOSE_MAIL_WITH_ATTACHMENT_DESC', 'Om de afsluitingsdatum van een brief bij te werken (closing_date van tabel mlb_coll_ext) met VERPLICHTE aanwezigheid van bijlage(n) / nota(‘s).');} +//if (!defined('_CLOSE_MAIL_WITH_ATTACHMENT_DESC')) { define('_CLOSE_MAIL_WITH_ATTACHMENT_DESC', 'Om de afsluitingsdatum van een brief bij te werken (closing_date van tabel res_letterbox) met VERPLICHTE aanwezigheid van bijlage(n) / nota(‘s).');} if (!defined('_ACTION_NOT_IN_DB')) { define('_ACTION_NOT_IN_DB', 'Actie niet bewaard in database');} if (!defined('_ERROR_PARAM_ACTION')) { define('_ERROR_PARAM_ACTION', 'Fout instelling van de actie');} if (!defined('_SQL_ERROR')) { define('_SQL_ERROR', 'SQL fout');} @@ -962,7 +962,7 @@ if (!defined('_HELP_FULLTEXT_SEARCH_EXEMPLE2')) { define('_HELP_FULLTEXT_SEARCH_ if (!defined('_HELP_FULLTEXT_SEARCH_EXEMPLE3')) { define('_HELP_FULLTEXT_SEARCH_EXEMPLE3', 'snel~ vindt uw snel');} if (!defined('_TIPS_FULLTEXT_TEXT')) { define('_TIPS_FULLTEXT_TEXT', 'Er kunnen ook getallen opgezocht worden');} if (!defined('_CLOSE_MAIL')) { define('_CLOSE_MAIL', 'Een brief afsluiten');} -if (!defined('_CLOSE_MAIL_DESC')) { define('_CLOSE_MAIL_DESC', 'Om de afsluitingsdatum van een brief bij te werken (closing_date van tabel mlb_coll_ext). ESSENTIEEL om uw documentworkflow af te sluiten.');} +if (!defined('_CLOSE_MAIL_DESC')) { define('_CLOSE_MAIL_DESC', 'Om de afsluitingsdatum van een brief bij te werken (closing_date van tabel res_letterbox). ESSENTIEEL om uw documentworkflow af te sluiten.');} if (!defined('_HELP_KEYWORD0')) { define('_HELP_KEYWORD0', 'Id van de verbonden gebruiker');} if (!defined('_HELP_BY_CORE')) { define('_HELP_BY_CORE', 'Sleutelwoorden van Maarch Core');} if (!defined('_FIRSTNAME_UPPERCASE')) { define('_FIRSTNAME_UPPERCASE', 'VOORNAAM');} @@ -1321,7 +1321,7 @@ if (!defined('_VIEW_FULL_HISTORY')) { define('_VIEW_FULL_HISTORY', 'De volledige if (!defined('_ONLY_ALPHANUM')) { define('_ONLY_ALPHANUM', 'Enkel alfanumerieke tekens worden aanvaard');} if (!defined('_ONLY_ALPHABETIC')) { define('_ONLY_ALPHABETIC', 'Enkel alfabetische tekens worden aanvaard');} if (!defined('_CLOSE_MAIL_AND_INDEX')) { define('_CLOSE_MAIL_AND_INDEX', 'Een brief afsluiten en de indexering starten');} -if (!defined('_CLOSE_MAIL_AND_INDEX_DESC')) { define('_CLOSE_MAIL_AND_INDEX_DESC', 'Om de afsluitingsdatum van een brief bij te werken (closing_date van tabel mlb_coll_ext) EN de indexeringspagina te openen om een nieuw document te bewaren.');} +if (!defined('_CLOSE_MAIL_AND_INDEX_DESC')) { define('_CLOSE_MAIL_AND_INDEX_DESC', 'Om de afsluitingsdatum van een brief bij te werken (closing_date van tabel res_letterbox) EN de indexeringspagina te openen om een nieuw document te bewaren.');} if (!defined('_DOC_NOT_CLOSED')) { define('_DOC_NOT_CLOSED', 'Deze brief is niet afgesloten');} if (!defined('_SECURITY_MESSAGE')) { define('_SECURITY_MESSAGE', 'Veiligheidsboodschap');} if (!defined('_SECURITY_MESSAGE_DETAILS')) { define('_SECURITY_MESSAGE_DETAILS', 'Verzoek van XSS type niet toegestaan');} diff --git a/apps/maarch_entreprise/loadNoteList.php b/apps/maarch_entreprise/loadNoteList.php index a51085a45fbca1b6207cbcde003ec3b3241bfadb..8a49da624706a79dce398685ee0be52c4ac7bafe 100755 --- a/apps/maarch_entreprise/loadNoteList.php +++ b/apps/maarch_entreprise/loadNoteList.php @@ -59,13 +59,16 @@ if (isset($_REQUEST['identifier'])) { } else { $query .= "''"; } + + $stmt3 = $db->query("SELECT id FROM USERS WHERE user_id = ?", array($_SESSION['user']['UserId'])); + $userInfo = $stmt3->fetchObject(); $query .= ") "; $query .= "OR "; $query .= "item_id IS NULL "; $query .= ") "; $query .= "OR "; - $query .= "user_id = '" . $_SESSION['user']['UserId'] . "' "; + $query .= "user_id = " . $userInfo->id . " "; $query .= ") "; $query .= " order by creation_date desc"; diff --git a/apps/maarch_entreprise/my_contacts/my_contact_del.php b/apps/maarch_entreprise/my_contacts/my_contact_del.php index 6d8dad4841948c52d4d879efb1941ff1cf11c669..4185facdb78844267b5b72798abd9f173b69611d 100755 --- a/apps/maarch_entreprise/my_contacts/my_contact_del.php +++ b/apps/maarch_entreprise/my_contacts/my_contact_del.php @@ -75,10 +75,8 @@ if(isset($_REQUEST['valid'])) $new_address = $_REQUEST['address']; $i=0; - $db->query("UPDATE ".$_SESSION['collections'][$i]['extensions'][$i] - . " SET exp_contact_id = ?, address_id = ? where exp_contact_id = ?", array($new_contact, $new_address, $s_id)); - $db->query("UPDATE ".$_SESSION['collections'][$i]['extensions'][$i] - . " SET dest_contact_id = ?, address_id = ? where dest_contact_id = ?", array($new_contact, $new_address, $s_id)); + $db->query("UPDATE res_letterbox SET exp_contact_id = ?, address_id = ? where exp_contact_id = ?", array($new_contact, $new_address, $s_id)); + $db->query("UPDATE res_letterbox SET dest_contact_id = ?, address_id = ? where dest_contact_id = ?", array($new_contact, $new_address, $s_id)); $db->query("DELETE FROM " . $_SESSION['tablename']['contacts_v2'] . " WHERE contact_id = ?", array($s_id)); $db->query("DELETE FROM " . $_SESSION['tablename']['contact_addresses'] . " WHERE contact_id = ?", array($s_id)); if($_SESSION['history']['contactdel']) diff --git a/apps/maarch_entreprise/reports/get_report_by_period_val.php b/apps/maarch_entreprise/reports/get_report_by_period_val.php index e064d7ba04226db44a2400ad2c0289565bc891bc..21eec9c514fd8df499c2bb55a08eb47180fcd3b5 100755 --- a/apps/maarch_entreprise/reports/get_report_by_period_val.php +++ b/apps/maarch_entreprise/reports/get_report_by_period_val.php @@ -721,22 +721,19 @@ else foreach(array_keys($_SESSION['coll_categories']['letterbox_coll']) as $key) { - if($key!='default_category'){ - $stmt = $db->query("SELECT count(res_id) as total FROM ".$view - . " WHERE status not in ('DEL','BAD') AND category_id = '".$key."' ".$where_date." ".$where_status." ".$where_priority." ".$where_entities, $arrayPDO); - $res = $stmt->fetchObject(); - - if($report_type == 'graph') - { - array_push($_SESSION['labels1'], utf8_decode(functions::wash_html($_SESSION['coll_categories']['letterbox_coll'][$key], 'NO_ACCENT'))); - array_push($vol_an, $res->total); - } - elseif($report_type == 'array') - { - array_push($data, array('LABEL' => $_SESSION['coll_categories']['letterbox_coll'][$key], 'VALUE' => $res->total )); - array_push($totalCourrier, $res->total); - } + $stmt = $db->query("SELECT count(res_id) as total FROM ".$view + . " WHERE status not in ('DEL','BAD') AND category_id = '".$key."' ".$where_date." ".$where_status." ".$where_priority." ".$where_entities, $arrayPDO); + $res = $stmt->fetchObject(); + if($report_type == 'graph') + { + array_push($_SESSION['labels1'], utf8_decode(functions::wash_html($_SESSION['coll_categories']['letterbox_coll'][$key], 'NO_ACCENT'))); + array_push($vol_an, $res->total); + } + elseif($report_type == 'array') + { + array_push($data, array('LABEL' => $_SESSION['coll_categories']['letterbox_coll'][$key], 'VALUE' => $res->total )); + array_push($totalCourrier, $res->total); } } diff --git a/apps/maarch_entreprise/xml/IVS/data_types.xml b/apps/maarch_entreprise/xml/IVS/data_types.xml index c0f885ed52035bf857171b344ee4f067dc0c46ef..f2da1573a8aa6930707757b3f5dbf157ff8410b7 100755 --- a/apps/maarch_entreprise/xml/IVS/data_types.xml +++ b/apps/maarch_entreprise/xml/IVS/data_types.xml @@ -76,7 +76,6 @@ <enumeration value="res_letterbox" /> <enumeration value="res_business" /> <enumeration value="res_attachments" /> - <enumeration value="mlb_coll_ext" /> <enumeration value="business_coll_ext" /> <enumeration value="folders" /> </dataType> diff --git a/apps/maarch_entreprise/xml/config.xml.default b/apps/maarch_entreprise/xml/config.xml.default index 4f18206fcafaf2794a20329c932bdb69beaaabfd..19082d1f0a19947a7879c75c67257e9a42159d76 100755 --- a/apps/maarch_entreprise/xml/config.xml.default +++ b/apps/maarch_entreprise/xml/config.xml.default @@ -51,32 +51,6 @@ <script_search>search_letterbox.php</script_search> <script_search_result>list_results_letterbox.php</script_search_result> <script_details>details.php</script_details> - <extensions> - <table>mlb_coll_ext</table> - </extensions> - <categories> - <category> - <id>incoming</id> - <label>_INCOMING</label> - </category> - <category> - <id>outgoing</id> - <label>_OUTGOING</label> - </category> - <category> - <id>internal</id> - <label>_INTERNAL</label> - </category> - <category> - <id>ged_doc</id> - <label>_GED_DOC</label> - </category> - <category> - <id>attachment</id> - <label>_ATTACHMENT</label> - </category> - <default_category>incoming</default_category> - </categories> </COLLECTION> <COLLECTION> <id>attachments_coll</id> @@ -90,16 +64,6 @@ <script_search>search_attachments.php</script_search> <script_search_result>list_results_attachments.php</script_search_result> <script_details>details_attachments.php</script_details> - <extensions> - <table/> - </extensions> - <categories> - <category> - <id>incoming</id> - <label>_INCOMING</label> - </category> - <default_category>incoming</default_category> - </categories> </COLLECTION> <COLLECTION> <id>attachments_version_coll</id> @@ -113,16 +77,6 @@ <script_search>search_attachments.php</script_search> <script_search_result>list_results_attachments.php</script_search_result> <script_details>details_attachments.php</script_details> - <extensions> - <table/> - </extensions> - <categories> - <category> - <id>incoming</id> - <label>_INCOMING</label> - </category> - <default_category>incoming</default_category> - </categories> </COLLECTION> <COLLECTION> <id>archive_transfer_coll</id> diff --git a/core/class/ExportControler.php b/core/class/ExportControler.php index c63d481c4f36f99561b78b9fc84260a4e1b5b055..bda79856a247fe57970cc98f378ab828c18e6429 100755 --- a/core/class/ExportControler.php +++ b/core/class/ExportControler.php @@ -375,7 +375,7 @@ class ExportFunctions { $db = new Database(); - $query = 'SELECT ct.label from contacts_v2 cont LEFT JOIN mlb_coll_ext mlb ON (mlb.exp_contact_id = cont.contact_id OR mlb.dest_contact_id = cont.contact_id) LEFT JOIN contact_types ct ON ct.id = cont.contact_type WHERE mlb.res_id = ?'; + $query = 'SELECT ct.label from contacts_v2 cont LEFT JOIN res_letterbox rlb ON (rlb.exp_contact_id = cont.contact_id OR rlb.dest_contact_id = cont.contact_id) LEFT JOIN contact_types ct ON ct.id = cont.contact_type WHERE rlb.res_id = ?'; $stmt = $db->query($query, array($res_id)); $result = $stmt->fetchObject(); @@ -386,7 +386,7 @@ class ExportFunctions { $db = new Database(); - $query = 'SELECT cont.title from contacts_v2 cont LEFT JOIN mlb_coll_ext mlb ON (mlb.exp_contact_id = cont.contact_id OR mlb.dest_contact_id = cont.contact_id) WHERE mlb.res_id = ?'; + $query = 'SELECT cont.title from contacts_v2 cont LEFT JOIN res_letterbox rlb ON (rlb.exp_contact_id = cont.contact_id OR rlb.dest_contact_id = cont.contact_id) WHERE rlb.res_id = ?'; $stmt = $db->query($query, array($res_id)); $result = $stmt->fetchObject(); @@ -397,7 +397,7 @@ class ExportFunctions { $db = new Database(); - $query = 'SELECT c.function FROM mlb_coll_ext r LEFT JOIN contacts_v2 c ON c.contact_id = r.dest_contact_id WHERE r.res_id = ?'; + $query = 'SELECT c.function FROM res_letterbox r LEFT JOIN contacts_v2 c ON c.contact_id = r.dest_contact_id WHERE r.res_id = ?'; $stmt = $db->query($query, array($res_id)); $result = $stmt->fetchObject(); @@ -475,7 +475,7 @@ class ExportFunctions { $db = new Database(); - $query = 'SELECT category_id FROM mlb_coll_ext WHERE res_id = ?'; + $query = 'SELECT category_id FROM res_letterbox WHERE res_id = ?'; $stmt = $db->query($query, array($res_id)); $result = $stmt->fetchObject(); diff --git a/core/class/LinkController.php b/core/class/LinkController.php index cc0f7d8a869fe89a693af3dab1a30adbe8f65080..47fb2bc3d11981e61455842f07ec4a94600be717 100755 --- a/core/class/LinkController.php +++ b/core/class/LinkController.php @@ -269,7 +269,7 @@ class LinkController { $db = new Database(); - $altIdentifierRequest = 'SELECT alt_identifier FROM mlb_coll_ext where res_id = ?'; + $altIdentifierRequest = 'SELECT alt_identifier FROM res_letterbox where res_id = ?'; $stmt = $db->query($altIdentifierRequest, array($resId)); while ($altIdentifierResult = $stmt->fetchObject()) { $altIdentifier = $altIdentifierResult->alt_identifier; diff --git a/core/class/class_security.php b/core/class/class_security.php index a5516cedd910a37fba544ff91e235926fd5a5758..edfbd340029bcda1eaed8886f7eb3dcf68c66f3b 100755 --- a/core/class/class_security.php +++ b/core/class/class_security.php @@ -374,24 +374,6 @@ class security extends Database return ''; } - /** - * Returns the collection extension table from a collId. - * - * @param $collId string collection ID - * - * @return string version table or empty string if not found - */ - public function retrieve_extension_table_from_coll_id($collId) - { - for ($i = 0; $i < count($_SESSION['collections']); ++$i) { - if ($_SESSION['collections'][$i]['id'] == $collId) { - return $_SESSION['collections'][$i]['extensions'][0]; - } - } - - return ''; - } - /** * Returns the adr table from a table. * diff --git a/core/class/resources_controler.php b/core/class/resources_controler.php index 031ffe577617046d08ee33e6f329d796c9eab68c..ec3984b7f9c16672af46c04ec682e1a71fce2bc4 100755 --- a/core/class/resources_controler.php +++ b/core/class/resources_controler.php @@ -54,499 +54,6 @@ try { */ class resources_controler { - ##################################### - ## Web Service de versement de donn�es issue du gros scanner - ##################################### - public function storeResource($encodedFile, $dataObject, $collId, $table, $fileFormat, $status) - { - try { - $func = new functions(); - $theData = $func->object2array($dataObject); - if (count($theData) == 1) { - $data = array(); - if (is_array($theData['datas'])) { - array_push($data, $theData['datas']); - } else { - array_push($data, $theData); - } - } else { - $data = $theData; - } - for ($i=0;$i< count($data);$i++) { - $data[$i]['column'] = strtolower($data[$i]['column']); - } - - $returnCode = 0; - $db = new Database(); - //copy sended file on tmp - $fileContent = base64_decode($encodedFile); - $random = rand(); - $fileName = 'tmp_file_' . $random . '.' . $fileFormat; - $Fnm = $_SESSION['config']['tmppath'] . $fileName; - $inF = fopen($Fnm,"w"); - fwrite($inF, $fileContent); - fclose($inF); - //store resource on docserver - $docserverControler = new docservers_controler(); - $fileInfos = array( - 'tmpDir' => $_SESSION['config']['tmppath'], - 'size' => filesize($Fnm), - 'format' => $fileFormat, - 'tmpFileName' => $fileName, - ); - //print_r($fileInfos); - $storeResult = array(); - $storeResult = $docserverControler->storeResourceOnDocserver( - $collId, $fileInfos - ); - if (!empty($storeResult['error'])) { - $returnResArray = array( - 'returnCode' => (int) -3, - 'resId' => '', - 'error' => $storeResult['error'], - ); - return $returnResArray; - } - //print_r($storeResult);exit; - //store resource metadata in database - $resource = new resource(); - - $data = $this->prepareStorage( - $data, - $storeResult['docserver_id'], - $status, - $fileFormat, - $table - ); - unlink($Fnm); - //var_dump($data);exit; - $resId = $resource->load_into_db( - $table, - $storeResult['destination_dir'], - $storeResult['file_destination_name'], - $storeResult['path_template'], - $storeResult['docserver_id'], - $data, - $_SESSION['config']['databasetype'], - true - ); - if (!is_numeric($resId)) { - $returnResArray = array( - 'returnCode' => (int) -2, - 'resId' => '', - 'error' => 'Pb with SQL insertion : ' .$resId , - ); - return $returnResArray; - } - if ($resId == 0) { - $resId = ''; - } - $returnResArray = array( - 'returnCode' => (int) 0, - 'resId' => $resId, - 'error' => '', - ); - return $returnResArray; - } catch (Exception $e) { - $returnResArray = array( - 'returnCode' => (int) -1, - 'resId' => '', - 'error' => 'unknown error' . $e->getMessage(), - ); - return $returnResArray; - } - } - - private function prepareStorage($data, $docserverId, $status, $fileFormat, $table) - { - $statusFound = false; - $typistFound = false; - $typeIdFound = false; - $toAddressFound = false; - $userPrimaryEntity = false; - $destinationFound = false; - $initiatorFound = false; - $attachmentTypeFound = false; - $db = new Database(); - for ($i=0;$i<count($data);$i++) { - if (strtoupper($data[$i]['type']) == 'INTEGER' || strtoupper($data[$i]['type']) == 'FLOAT') { - if ($data[$i]['value'] == '') { - $data[$i]['value'] = '0'; - } - } - if (strtoupper($data[$i]['type']) == 'STRING') { - $data[$i]['value'] = str_replace(";", "", $data[$i]['value']); - $data[$i]['value'] = str_replace("--", "", $data[$i]['value']); - } - if (strtoupper($data[$i]['column']) == strtoupper('status')) { - $statusFound = true; - } - if (strtoupper($data[$i]['column']) == strtoupper('typist')) { - $typistFound = true; - } - if (strtoupper($data[$i]['column']) == strtoupper('type_id')) { - $typeIdFound = true; - } - if (strtoupper($data[$i]['column']) == strtoupper('custom_t10')) { - require_once 'core/class/class_db_pdo.php'; - $db = new Database(); - $mail = array(); - $theString = str_replace(">", "", $data[$i]['value']); - $mail = explode("<", $theString); - $queryUser = "SELECT user_id FROM users WHERE mail = ? and status = 'OK'"; - $stmt = $db->query($queryUser, array($mail[count($mail) -1])); - $userIdFound = $stmt->fetchObject(); - if (!empty($userIdFound->user_id)) { - $toAddressFound = true; - $destUser = $userIdFound->user_id; - - $queryUserEntity = "SELECT entity_id FROM users_entities WHERE primary_entity = 'Y' and user_id = ?"; - $stmt = $db->query($queryUserEntity, array($destUser)); - $userEntityId = $stmt->fetchObject(); - if (!empty($userEntityId->entity_id)) { - $userEntity = $userEntityId->entity_id; - $userPrimaryEntity = true; - } - }else{ - $queryEntity = "SELECT entity_id FROM entities WHERE email = ? and enabled = 'Y'"; - $stmt = $db->query($queryEntity, array($mail[count($mail) -1])); - $entityIdFound = $stmt->fetchObject(); - $userEntity = $entityIdFound->entity_id; - if(!empty($userEntity)){ - $userPrimaryEntity = true; - } - - } - } - if (strtoupper($data[$i]['column']) == strtoupper('attachment_type')) { - $attachmentTypeFound = true; - } - } - if (!$typistFound && !$toAddressFound) { - array_push( - $data, - array( - 'column' => 'typist', - 'value' => 'auto', - 'type' => 'string', - ) - ); - } - if (!$typeIdFound) { - array_push( - $data, - array( - 'column' => 'type_id', - 'value' => '10', - 'type' => 'string', - ) - ); - } - if (!$statusFound) { - array_push( - $data, - array( - 'column' => 'status', - 'value' => $status, - 'type' => 'string', - ) - ); - } - if ($toAddressFound) { - array_push( - $data, - array( - 'column' => 'dest_user', - 'value' => $destUser, - 'type' => 'string', - ) - ); - array_push( - $data, - array( - 'column' => 'typist', - 'value' => $destUser, - 'type' => 'string', - ) - ); - } - if ($userPrimaryEntity) { - for ($i=0;$i<count($data);$i++) { - if (strtoupper($data[$i]['column']) == strtoupper('destination')) { - if ($data[$i]['value'] == "") { - $data[$i]['value'] = $userEntity; - } - $destinationFound = true; - break; - } - } - if (!$destinationFound) { - array_push( - $data, - array( - 'column' => 'destination', - 'value' => $userEntity, - 'type' => 'string', - ) - ); - } - } - if ($userPrimaryEntity) { - for ($i=0;$i<count($data);$i++) { - if (strtoupper($data[$i]['column']) == strtoupper('initiator')) { - if ($data[$i]['value'] == "") { - $data[$i]['value'] = $userEntity; - } - $initiatorFound = true; - break; - } - } - if (!$initiatorFound) { - array_push( - $data, - array( - 'column' => 'initiator', - 'value' => $userEntity, - 'type' => 'string', - ) - ); - } - } - - if (!$attachmentTypeFound && $table == 'res_attachments') { - array_push( - $data, - array( - 'column' => 'attachment_type', - 'value' => 'simple_attachment', - 'type' => 'string', - ) - ); - } - - array_push( - $data, - array( - 'column' => 'format', - 'value' => $fileFormat, - 'type' => 'string', - ) - ); - array_push( - $data, - array( - 'column' => 'docserver_id', - 'value' => $docserverId, - 'type' => 'string', - ) - ); - return $data; - } - - ##################################### - ## Store datas of the resource in extension table - ##################################### - public function storeExtResource($resId, $data, $table) - { - try { - if ($resId <> "") { - $func = new functions(); - $data = $func->object2array($data); - $queryExtFields = '('; - $queryExtValues = '('; - $queryExtValuesFinal = '('; - $parameters = array(); - $db = new Database(); - $findProcessLimitDate = false; - $delayProcessNotes = 0; - - for ($i=0;$i<count($data);$i++) { - if ($data[$i]['column'] == 'process_limit_date') { - $findProcessLimitDate = true; - } - } - - if ($table == 'mlb_coll_ext') { - if ($delayProcessNotes > 0) { - $processLimitDate = $this->retrieveProcessLimitDate( - $resId, - $delayProcessNotes, - $calendarType - ); - } else { - $processLimitDate = $this->retrieveProcessLimitDate($resId); - } - //echo $processLimitDate; - } - - if (!$findProcessLimitDate && $processLimitDate <> '') { - array_push( - $data, - array( - 'column' => 'process_limit_date', - 'value' => $processLimitDate, - 'type' => 'date', - ) - ); - } - - //var_dump($data); - for ($i=0;$i<count($data);$i++) { - if (strtoupper($data[$i]['type']) == 'INTEGER' || strtoupper($data[$i]['type']) == 'FLOAT') { - if ($data[$i]['value'] == '') { - $data[$i]['value'] = '0'; - } - $data[$i]['value'] = str_replace(',' , '.', $data[$i]['value']); - } - if (strtoupper($data[$i]['column']) == strtoupper('category_id')) { - $categoryId = $data[$i]['value']; - } - if (strtoupper($data[$i]['column']) == strtoupper('alt_identifier') && $data[$i]['value'] == "") { - require_once 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] - . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_chrono.php'; - $chronoX = new chrono(); - for ($iColl=0; $iColl<=count($_SESSION['collections']); $iColl++) { - if ($_SESSION['collections'][$iColl]['extensions'][0] == $table) { - $resViewTable = $_SESSION['collections'][$iColl]['view']; - break; - } - } - $stmt = $db->query("SELECT destination, type_id FROM ".$resViewTable." WHERE res_id = ?", array($resId)); - $resView = $stmt->fetchObject(); - $myVars = array( - 'entity_id' => $resView->destination, - 'type_id' => $resView->type_id, - 'category_id' => $categoryId, - 'folder_id' => "", - ); - $myChrono = $chronoX->generate_chrono($categoryId, $myVars, 'false'); - $data[$i]['value'] = $myChrono; - } - if (strtoupper($data[$i]['column']) == strtoupper('exp_contact_id') && $data[$i]['value'] <> "" && !is_numeric($data[$i]['value'])) { - $theString = str_replace(">", "", $data[$i]['value']); - $mail = explode("<", $theString); - $stmt = $db->query("SELECT contact_id FROM view_contacts WHERE email = ? and enabled = 'Y' order by creation_date asc", array($mail[count($mail) -1])); - $contact = $stmt->fetchObject(); - - if ($contact->contact_id <> "") { - $data[$i]['value'] = $contact->contact_id; - } else { - $data[$i]['value'] = 0; - } - } - if (strtoupper($data[$i]['column']) == strtoupper('address_id') && $data[$i]['value'] <> "" && !is_numeric($data[$i]['value'])) { - $theString = str_replace(">", "", $data[$i]['value']); - $mail = explode("<", $theString); - $stmt = $db->query("SELECT ca_id FROM view_contacts WHERE email = ? and enabled = 'Y' order by creation_date asc", array($mail[count($mail) -1])); - $contact = $stmt->fetchObject(); - if ($contact->ca_id <> "") { - $data[$i]['value'] = $contact->ca_id; - } else { - $data[$i]['value'] = 0; - } - } - //COLUMN - $data[$i]['column'] = strtolower($data[$i]['column']); - $queryExtFields .= $data[$i]['column'] . ','; - //VALUE - if ($data[$i]['type'] == 'string' || $data[$i]['type'] == 'date') { - $queryExtValues .= "'" . $data[$i]['value'] . "',"; - } else { - $queryExtValues .= $data[$i]['value'] . ","; - } - $parameters[] = $data[$i]['value']; - $queryExtValuesFinal .= "?,"; - } - $queryExtFields = preg_replace('/,$/', ',res_id)', $queryExtFields); - $queryExtValues = preg_replace( - '/,$/', ',' . $resId . ')', $queryExtValues - ); - $queryExtValuesFinal = preg_replace( - '/,$/', ',' . $resId . ')', $queryExtValuesFinal - ); - /*$queryExt = " insert into " . $table . " " . $queryExtFields - . ' values ' . $queryExtValues ;*/ - $queryExt = " insert into " . $table . " " . $queryExtFields - . ' values ' . $queryExtValuesFinal ; - //echo $queryExt;exit; - $returnCode = 0; - if ($db->query($queryExt, $parameters)) { - $returnResArray = array( - 'returnCode' => (int) 0, - 'resId' => $resId, - 'error' => '', - ); - } else { - $returnResArray = array( - 'returnCode' => (int) -2, - 'resId' => '', - 'error' => 'Pb with SQL insertion', - ); - } - return $returnResArray; - } else { - $returnResArray = array( - 'returnCode' => (int) -3, - 'resId' => '', - 'error' => 'resId is not set', - ); - return $returnResArray; - } - } catch (Exception $e) { - $returnResArray = array( - 'returnCode' => (int) -1, - 'resId' => '', - 'error' => 'unknown error' . $e->getMessage(), - ); - return $returnResArray; - } - } - - ##################################### - ## Retrieve process_limit_date for resource in extension table if mlb - ##################################### - public function retrieveProcessLimitDate($resId, $defaultDelay = 0, $calendarType = FALSE) - { - $processLimitDate = ''; - if ($resId <> '') { - $db = new Database(); - $stmt = $db->query("select creation_date, admission_date, " - . "type_id from res_view_letterbox where res_id = ?" - , array($resId) - ); - $line = $stmt->fetchObject(); - if ($line->type_id <> '') { - $typeId = $line->type_id; - $admissionDate = $line->admission_date; - $creationDate = $line->creation_date; - $delay = 30; - } - if ($admissionDate == '') { - $dateToCompute = $creationDate; - } else { - $dateToCompute = $admissionDate; - } - if ($defaultDelay > 0) { - $delay = $defaultDelay; - } elseif ($delay == 0) { - $delay = 5; - } - require_once('core/class/class_alert_engine.php'); - $alert_engine = new alert_engine(); - if (isset($dateToCompute) && !empty($dateToCompute)) { - - $convertedDate = $alert_engine->dateFR2Time( - str_replace("-", "/", $db->format_date_db($dateToCompute,'true','','true')), true - ); - $date = $alert_engine->WhenOpenDay($convertedDate, $delay, false ,$calendarType); - - } else { - $date = $alert_engine->date_max_treatment($delay, false); - } - $processLimitDate = $db->dateformat($date, '-'); - } - return $processLimitDate; - } ##################################### ## Web Service to retrieve attachment from an identifier diff --git a/core/class/ws.php b/core/class/ws.php index 8a08640800ca53cb4ebf48061d31d6323eeedff9..cb896894c1938a7f44f82bea60319330ef2e3457 100755 --- a/core/class/ws.php +++ b/core/class/ws.php @@ -28,31 +28,6 @@ $SOAP_typedef['returnViewResource'] = array('status'=>'string', 'called_by_ws'=>'boolean', 'error'=>'string' ); -$SOAP_dispatch_map['docserverSave'] = array( - 'in' => array('docserver' => '{urn:MaarchSoapServer}docservers', 'mode' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#docservers::save" - ); -$SOAP_dispatch_map['docserverDelete'] = array( - 'in' => array('docserver' => '{urn:MaarchSoapServer}docservers'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#docservers::delete" - ); -$SOAP_dispatch_map['docserverEnable'] = array( - 'in' => array('docserver' => '{urn:MaarchSoapServer}docservers'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#docservers::enable" - ); -$SOAP_dispatch_map['docserverDisable'] = array( - 'in' => array('docserver' => '{urn:MaarchSoapServer}docservers'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#docservers::disable" - ); -$SOAP_dispatch_map['docserverGet'] = array( - 'in' => array('docserverId' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}docservers'), - 'method' => "core#docservers::getWs" - ); $SOAP_dispatch_map['viewResource'] = array( 'in' => Array('gedId' => 'string', 'tableName' => 'string', 'adrTableName' => 'string', 'calledByWS' => 'string'), 'out' => Array('return' => '{urn:MaarchSoapServer}returnViewResource'), @@ -64,31 +39,6 @@ $SOAP_typedef['docserverTypes'] = array( 'docserver_type_id'=>'string', 'docserver_type_label'=>'string', 'fingerprint_mode'=>'string' ); -$SOAP_dispatch_map['docserverTypeSave'] = array( - 'in' => array('docserver_type' => '{urn:MaarchSoapServer}docserverTypes', 'mode' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#docserver_types::save" - ); -$SOAP_dispatch_map['docserverTypeDelete'] = array( - 'in' => array('docserver_type' => '{urn:MaarchSoapServer}docserverTypes'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#docserver_types::delete" - ); -$SOAP_dispatch_map['docserverTypeEnable'] = array( - 'in' => array('docserver_type' => '{urn:MaarchSoapServer}docserverTypes'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#docserver_types::enable" - ); -$SOAP_dispatch_map['docserverTypeDisable'] = array( - 'in' => array('docserver_type' => '{urn:MaarchSoapServer}docserverTypes'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#docserver_types::disable" - ); -$SOAP_dispatch_map['docserverTypeGet'] = array( - 'in' => array('docserverTypeId' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}docserverTypes'), - 'method' => "core#docserver_types::getWs" - ); /**************************************************************************************************/ // USERS $SOAP_typedef['users'] = array( 'user_id'=>'string', @@ -99,31 +49,12 @@ $SOAP_typedef['users'] = array( 'user_id'=>'string', 'mail'=>'string', 'loginmode'=>'string' ); -$SOAP_dispatch_map['userSave'] = array( - 'in' => array('user' => '{urn:MaarchSoapServer}users', 'mode' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#users::save" - ); + $SOAP_dispatch_map['userDelete'] = array( 'in' => array('user' => '{urn:MaarchSoapServer}users'), 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), 'method' => "core#users::delete" ); -$SOAP_dispatch_map['userEnable'] = array( - 'in' => array('user' => '{urn:MaarchSoapServer}users'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#users::enable" - ); -$SOAP_dispatch_map['userDisable'] = array( - 'in' => array('user' => '{urn:MaarchSoapServer}users'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "core#users::disable" - ); -$SOAP_dispatch_map['userGet'] = array( - 'in' => array('user' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}users'), - 'method' => "core#users::getWs" - ); $SOAP_typedef['returnArrayUser'] = array( 'userEntities'=>'{urn:MaarchSoapServer}arrayOfEntities', 'isUser'=>'boolean', @@ -169,29 +100,6 @@ $SOAP_typedef['returnResArray'] = array( 'error' => 'string' ); -$SOAP_dispatch_map['storeResource'] = array( - 'in' => array( - 'encodedFile' => 'string', - 'data' => '{urn:MaarchSoapServer}arrayOfData', - 'collId' => 'string', - 'table' => 'string', - 'fileFormat' => 'string', - 'status' => 'string', - ), - 'out' => array('return' => '{urn:MaarchSoapServer}returnResArray'), - 'method' => "core#resources::storeResource", -); - -$SOAP_dispatch_map['storeExtResource'] = array( - 'in' => array( - 'resId' => 'long', - 'data' => '{urn:MaarchSoapServer}arrayOfData', - 'table' => 'string', - ), - 'out' => array('return' => '{urn:MaarchSoapServer}returnResArray'), - 'method' => "core#resources::storeExtResource", -); - $SOAP_typedef['searchParams'] = array( 'country' => 'string', 'docDate' => 'date', diff --git a/modules/attachments/attachments_content.php b/modules/attachments/attachments_content.php index 5d0fb84e417a8e9bf40ee1bab53d48fd3a060699..6bfbbd745ef22f7694746d2c8bea816f82bb1bf2 100755 --- a/modules/attachments/attachments_content.php +++ b/modules/attachments/attachments_content.php @@ -1363,7 +1363,7 @@ if (isset($_REQUEST['id'])) { //On recherche le type de document attaché à ce courrier } - $stmt = $db->query('SELECT r.type_id, r.creation_date, m.category_id FROM res_letterbox r INNER JOIN mlb_coll_ext m ON m.res_id = r.res_id WHERE r.res_id = ?', array($_SESSION['doc_id'])); + $stmt = $db->query('SELECT type_id, creation_date, category_id FROM res_letterbox WHERE res_id = ?', array($_SESSION['doc_id'])); $mail_doctype = $stmt->fetchObject(); $type_id = $mail_doctype->type_id; $category_id = $mail_doctype->category_id; diff --git a/modules/attachments/get_chrono_attachment.php b/modules/attachments/get_chrono_attachment.php index 1af2d0322dfc2ae9800df22d3d3035bfc0608171..04035fc4a301cfc27e21d9f3c6ab712ef0fb35a5 100755 --- a/modules/attachments/get_chrono_attachment.php +++ b/modules/attachments/get_chrono_attachment.php @@ -21,7 +21,7 @@ $db = new Database(); $index = $_REQUEST['index']; //RETRIEVE CATEGORY OF DOCUMENT -$stmt = $db->query("SELECT category_id FROM mlb_coll_ext WHERE res_id = ? ", array($_SESSION['doc_id'])); +$stmt = $db->query("SELECT category_id FROM res_letterbox WHERE res_id = ? ", array($_SESSION['doc_id'])); $resMaster = $stmt->fetchObject(); $category_id = $resMaster->category_id; @@ -48,7 +48,7 @@ if ($category_id == "incoming" || $category_id == 'attachment' || ($category_id echo "{status: 1, chronoNB: '".functions::xssafe($myChrono)."'}"; } } elseif ($category_id == "outgoing" && $nb_attachment == 0) { - $stmt = $db->query("SELECT alt_identifier FROM mlb_coll_ext WHERE res_id = ?", array($_SESSION['doc_id'])); + $stmt = $db->query("SELECT alt_identifier FROM res_letterbox WHERE res_id = ?", array($_SESSION['doc_id'])); $chronoMaster = $stmt->fetchObject(); echo "{status: 1, chronoNB: '".functions::xssafe($chronoMaster->alt_identifier)."'}"; } diff --git a/modules/attachments/get_other_chrono_attachment.php b/modules/attachments/get_other_chrono_attachment.php index 0f86865b2bccb94d723fa101a87345cc1b34ed95..7fd4b560b6c3e1d70cf661930544b11463fab8cb 100755 --- a/modules/attachments/get_other_chrono_attachment.php +++ b/modules/attachments/get_other_chrono_attachment.php @@ -35,7 +35,7 @@ while ($res = $stmt->fetchObject()) { array_push($listIdentifier, $res->identifier); } -$stmt = $db->query("SELECT category_id, alt_identifier FROM mlb_coll_ext WHERE res_id = ? ", array($_SESSION['doc_id'])); +$stmt = $db->query("SELECT category_id, alt_identifier FROM res_letterbox WHERE res_id = ? ", array($_SESSION['doc_id'])); $res = $stmt->fetchObject(); $category_id = $res->category_id; diff --git a/modules/attachments/show_res_id.php b/modules/attachments/show_res_id.php index 7d7bb518f5a8674f057d015825d5c58f886a9b2b..38e7e4a074ce89e44959a4bb494895b9dcf730d0 100755 --- a/modules/attachments/show_res_id.php +++ b/modules/attachments/show_res_id.php @@ -24,7 +24,7 @@ if (_ID_TO_DISPLAY == 'chrono_number') { $db = new Database(); $arrayChrono = array(); foreach ($_SESSION['stockCheckbox'] as $key => $value) { - $stmt = $db->query('SELECT alt_identifier FROM mlb_coll_ext WHERE res_id = ?', array($value)); + $stmt = $db->query('SELECT alt_identifier FROM res_letterbox WHERE res_id = ?', array($value)); $res = $stmt->fetchObject(); $chrono = $res->alt_identifier; array_push($arrayChrono, $chrono); diff --git a/modules/avis/class/avis_controler_Abstract.php b/modules/avis/class/avis_controler_Abstract.php index a46a0f310576e01d9968d363dee3667bcdcef382..47b7104fdacb49d44982dc8396a852adb8654f6d 100755 --- a/modules/avis/class/avis_controler_Abstract.php +++ b/modules/avis/class/avis_controler_Abstract.php @@ -19,7 +19,7 @@ abstract class avis_controler_Abstract //define avis limit date $db = new Database(); - $query = "SELECT notes.user_id,notes.note_text, opinion_limit_date FROM notes,mlb_coll_ext WHERE identifier = ? AND note_text LIKE '[POUR AVIS]%' AND notes.identifier = res_letterbox.res_id"; + $query = "SELECT notes.user_id,notes.note_text, opinion_limit_date FROM notes,res_letterbox WHERE identifier = ? AND note_text LIKE '[POUR AVIS]%' AND notes.identifier = res_letterbox.res_id"; $stmt = $db->query($query, array($resId)); diff --git a/modules/basket/class/ws.php b/modules/basket/class/ws.php index 61db4ff5179bb6d06ee06780b263f5e76949826e..915406c397202ddc0941dd0669c39460a7c52b1e 100755 --- a/modules/basket/class/ws.php +++ b/modules/basket/class/ws.php @@ -4,18 +4,6 @@ global $XMLRPC_dispatch_map; global $SOAP_typedef; global $REST_dispatch_map; -$XMLRPC_dispatch_map['basketSample'] = Array( - 'function' => 'basketSample', - 'signature' => array(array('string','string')), - 'docstring' => '', - 'method' => "modules/basket#basket::save" - ); - -$SOAP_dispatch_map['basketSample'] = Array( - 'in' => Array('in' => 'string'), - 'out' => Array('out' => 'string'), - 'method' => "modules/basket#basket::save" - ); $REST_dispatch_map['basket'] = Array( 'pathToController' => "modules/basket/class/cmis/cmis_basket_controller.php" ); \ No newline at end of file diff --git a/modules/content_management/dist/src/MaarchCM.java b/modules/content_management/dist/src/MaarchCM.java index d16c19695730b56fa9a966fc5e964ffd0dbd7c8e..4f46fc1be59076e7b8d0279c0405072cd4a3b8b3 100755 --- a/modules/content_management/dist/src/MaarchCM.java +++ b/modules/content_management/dist/src/MaarchCM.java @@ -374,7 +374,6 @@ public class MaarchCM { Set<String> whiteList = new HashSet<>(); whiteList.add("res_letterbox"); whiteList.add("res_attachments"); - whiteList.add("mlb_coll_ext"); whiteList.add("res_version_letterbox"); whiteList.add("res_view_attachments"); whiteList.add("res_view_letterbox"); diff --git a/modules/content_management/xml/IVS/data_types.xml b/modules/content_management/xml/IVS/data_types.xml index 25c95ff1c4fb680859c875f257691c24e0198ff8..92523040e9b2f88f86c426f0c2f95340d9d809e1 100755 --- a/modules/content_management/xml/IVS/data_types.xml +++ b/modules/content_management/xml/IVS/data_types.xml @@ -3,7 +3,6 @@ <enumeration value="res_letterbox" /> <enumeration value="res_business" /> <enumeration value="res_attachments" /> - <enumeration value="mlb_coll_ext" /> <enumeration value="business_coll_ext" /> <enumeration value="res_view_attachments" /> <enumeration value="res_view_letterbox" /> diff --git a/modules/export_seda/batch/config/config.xml.default b/modules/export_seda/batch/config/config.xml.default index d47ea12f1090c04eacbf794a49c11f79a7bcfe27..8aa79da07b372e10250f7ff98e62d86d52bde32e 100755 --- a/modules/export_seda/batch/config/config.xml.default +++ b/modules/export_seda/batch/config/config.xml.default @@ -12,7 +12,6 @@ <Table>res_letterbox</Table> <View>res_view_letterbox</View> <Adr>adr_letterbox</Adr> - <Extension>mlb_coll_ext</Extension> </COLLECTION> <CONFIG_BASE> <databaseserver>127.0.0.1</databaseserver> diff --git a/modules/life_cycle/batch/config/config_extract_data.xml.default b/modules/life_cycle/batch/config/config_extract_data.xml.default index 887c92fb7be9e7c66105e70db63eafdf62b21ddd..27c941936facb1b668ace87ae6d6d2713be003bf 100755 --- a/modules/life_cycle/batch/config/config_extract_data.xml.default +++ b/modules/life_cycle/batch/config/config_extract_data.xml.default @@ -24,7 +24,6 @@ <Id>letterbox_coll</Id> <Table>res_letterbox</Table> <View>res_view_letterbox</View> - <ExtTable>mlb_coll_ext</ExtTable> <VersionTable>res_version_letterbox</VersionTable> <Adr>adr_x</Adr> </COLLECTION> diff --git a/modules/life_cycle/batch/config/config_purge.xml.default b/modules/life_cycle/batch/config/config_purge.xml.default index 8c8c12090b48208140345143d31c844e04bc6d3e..9ae668cfcc08122968ff704c1e116fd5a752e451 100755 --- a/modules/life_cycle/batch/config/config_purge.xml.default +++ b/modules/life_cycle/batch/config/config_purge.xml.default @@ -25,7 +25,6 @@ <Id>res_coll</Id> <Table>res_x</Table> <View>res_view</View> - <ExtTable></ExtTable> <VersionTable>res_version_letterbox</VersionTable> <Adr>adr_x</Adr> </COLLECTION> diff --git a/modules/life_cycle/batch/load_extract_data.php b/modules/life_cycle/batch/load_extract_data.php index d424b0cc76d1f536d021c683e8f59fdde0c63212..893e60b89e18e1bf9b5945f7b8fb57d4349c93ad 100755 --- a/modules/life_cycle/batch/load_extract_data.php +++ b/modules/life_cycle/batch/load_extract_data.php @@ -204,7 +204,6 @@ foreach ($xmlconfig->COLLECTION as $col) { 'id' => (string) $col->Id, 'table' => (string) $col->Table, 'view' => (string) $col->View, - 'extensionTable' => (string) $col->ExtTable, 'versionTable' => (string) $col->VersionTable, 'adr' => (string) $col->Adr, ); @@ -212,7 +211,6 @@ foreach ($xmlconfig->COLLECTION as $col) { $GLOBALS['table'] = $GLOBALS['collections'][$i]['table']; $GLOBALS['adrTable'] = $GLOBALS['collections'][$i]['adr']; $GLOBALS['view'] = $GLOBALS['collections'][$i]['view']; - $GLOBALS['extensionTable'] = $GLOBALS['collections'][$i]['extensionTable']; $GLOBALS['versionTable'] = $GLOBALS['collections'][$i]['versionTable']; } $i++; diff --git a/modules/life_cycle/batch/load_extract_data_2.php b/modules/life_cycle/batch/load_extract_data_2.php index 255efcb983913b3419beb85b382d9464bf1a0caa..583b3380621b4d39b17b32e093965fbef5450394 100755 --- a/modules/life_cycle/batch/load_extract_data_2.php +++ b/modules/life_cycle/batch/load_extract_data_2.php @@ -213,7 +213,6 @@ foreach ($xmlconfig->COLLECTION as $col) { 'id' => (string) $col->Id, 'table' => (string) $col->Table, 'view' => (string) $col->View, - 'extensionTable' => (string) $col->ExtTable, 'versionTable' => (string) $col->VersionTable, 'adr' => (string) $col->Adr, ); @@ -221,7 +220,6 @@ foreach ($xmlconfig->COLLECTION as $col) { $GLOBALS['table'] = $GLOBALS['collections'][$i]['table']; $GLOBALS['adrTable'] = $GLOBALS['collections'][$i]['adr']; $GLOBALS['view'] = $GLOBALS['collections'][$i]['view']; - $GLOBALS['extensionTable'] = $GLOBALS['collections'][$i]['extensionTable']; $GLOBALS['versionTable'] = $GLOBALS['collections'][$i]['versionTable']; } $i++; diff --git a/modules/life_cycle/batch/load_process_purge.php b/modules/life_cycle/batch/load_process_purge.php index 49781c6591387698a01c9f9219aa10c1db2e3b87..b7bacf40e592c2eacb989a48ce9664543fce886f 100755 --- a/modules/life_cycle/batch/load_process_purge.php +++ b/modules/life_cycle/batch/load_process_purge.php @@ -231,7 +231,6 @@ foreach ($xmlconfig->COLLECTION as $col) { 'id' => (string) $col->Id, 'table' => (string) $col->Table, 'view' => (string) $col->View, - 'extensionTable' => (string) $col->ExtTable, 'versionTable' => (string) $col->VersionTable, 'adr' => (string) $col->Adr, ); @@ -239,7 +238,6 @@ foreach ($xmlconfig->COLLECTION as $col) { $GLOBALS['table'] = $GLOBALS['collections'][$i]['table']; $GLOBALS['adrTable'] = $GLOBALS['collections'][$i]['adr']; $GLOBALS['view'] = $GLOBALS['collections'][$i]['view']; - $GLOBALS['extensionTable'] = $GLOBALS['collections'][$i]['extensionTable']; $GLOBALS['versionTable'] = $GLOBALS['collections'][$i]['versionTable']; } $i++; diff --git a/modules/life_cycle/batch/process_garbage_collector.php b/modules/life_cycle/batch/process_garbage_collector.php index 1d9043a1690d29e073a0541ef06f12b2cf4981b4..dac59502f4dacb700356fc67579bd1877df2c1bf 100644 --- a/modules/life_cycle/batch/process_garbage_collector.php +++ b/modules/life_cycle/batch/process_garbage_collector.php @@ -76,7 +76,6 @@ while ($GLOBALS['state'] <> "END") { echo 'attach turn' . PHP_EOL; //SECOND SELECT THE ATTACH IN DEL STATUS $GLOBALS['table'] = 'res_attachments'; - $GLOBALS['exTable'] = ''; $GLOBALS['versionTable'] = 'res_version_attachments'; $GLOBALS['adrTable'] = 'adr_attachments'; $GLOBALS['attachAlreadyDone'] = true; @@ -85,7 +84,6 @@ while ($GLOBALS['state'] <> "END") { echo 'res turn' . PHP_EOL; //FIRST SELECT THE DOC IN DEL STATUS $GLOBALS['table'] = 'res_letterbox'; - $GLOBALS['exTable'] = 'mlb_coll_ext'; $GLOBALS['versionTable'] = ''; $GLOBALS['adrTable'] = 'adr_letterbox'; $GLOBALS['resAlreadyDone'] = true; @@ -100,7 +98,6 @@ while ($GLOBALS['state'] <> "END") { //THIRD SELECT THE ATTACH IN OBS STATUS $where_clause = "STATUS = 'OBS' and creation_date <= '" . $GLOBALS['dateToPurgeOBS'] . "'"; $GLOBALS['table'] = 'res_attachments'; - $GLOBALS['exTable'] = ''; $GLOBALS['versionTable'] = 'res_version_attachments'; $GLOBALS['adrTable'] = 'adr_attachments'; $GLOBALS['obsAlreadyDone'] = true; @@ -157,7 +154,6 @@ while ($GLOBALS['state'] <> "END") { array( 'res_id' => $resoucesRecordset->res_id, 'table' => $GLOBALS['table'], - 'ext_table' => $GLOBALS['extTable'], 'version_table' => $GLOBALS['versionTable'], 'docserver_id' => $resoucesRecordset->docserver_id, 'path_template' => $dsPath, @@ -350,16 +346,6 @@ while ($GLOBALS['state'] <> "END") { array($resourcesArray[$cptRes]["res_id"]) ); - if ($resourcesArray[$cptRes]['ext_table'] <> "") { - $deleteExtQuery = "$action FROM " . $resourcesArray[$cptRes]['ext_table'] - . " WHERE res_id = ?"; - $stmt = Bt_doQuery( - $GLOBALS['db'], - $deleteExtQuery, - array($resourcesArray[$cptRes]["res_id"]) - ); - } - if ($resourcesArray[$cptRes]['version_table'] <> "") { $deleteVersionQuery = "$action FROM " . $resourcesArray[$cptRes]['version_table'] . " WHERE res_id_master = ?"; diff --git a/modules/life_cycle/batch/process_purge.php b/modules/life_cycle/batch/process_purge.php index 6516b52b179735bacee1913920a65af9190f422e..c0fcb28c13d7c8b8879d7ad12f8b88e3fdf31781 100755 --- a/modules/life_cycle/batch/process_purge.php +++ b/modules/life_cycle/batch/process_purge.php @@ -341,16 +341,6 @@ while ($GLOBALS['state'] <> "END") { array($resourcesArray[$cptRes]["res_id"]) ); - if ($GLOBALS['extensionTable'] <> "") { - $deleteExtQuery = "DELETE FROM " . $GLOBALS['extensionTable'] - . " WHERE res_id = ?"; - $stmt = Bt_doQuery( - $GLOBALS['db'], - $deleteExtQuery, - array($resourcesArray[$cptRes]["res_id"]) - ); - } - if ($GLOBALS['versionTable'] <> "") { $deleteVersionQuery = "DELETE FROM " . $GLOBALS['versionTable'] . " WHERE res_id_master = ?"; diff --git a/modules/life_cycle/class/ws.php b/modules/life_cycle/class/ws.php index 8be7131bbda70ae18e14c3f1df84efda159425c9..b9aa6e3f5247ed46e95070cf446e6ce96f7c6d61 100755 --- a/modules/life_cycle/class/ws.php +++ b/modules/life_cycle/class/ws.php @@ -3,82 +3,4 @@ global $SOAP_dispatch_map; global $XMLRPC_dispatch_map; global $SOAP_typedef; -/******************************************************************************/ -// LC_POLICIES -$SOAP_typedef['lcPolicies'] = array( - 'policy_id' => 'string', - 'policy_name' => 'string', - 'policy_desc' => 'string', -); -$SOAP_dispatch_map['policySave'] = array( - 'in' => array( - 'policy' => '{urn:MaarchSoapServer}lcPolicies', - 'mode' => 'string', - ), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "modules/life_cycle#lc_policies::save", -); -$SOAP_dispatch_map['policyDelete'] = array( - 'in' => array('policy' => '{urn:MaarchSoapServer}lcPolicies'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "modules/life_cycle#lc_policies::delete", - ); -$SOAP_dispatch_map['policyGet'] = array( - 'in' => array('policyId' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}lcPolicies'), - 'method' => "modules/life_cycle#lc_policies::getWs", - ); -/**************************************************************************************************/ -// LC_CYCLES -$SOAP_typedef['lcCycles'] = array( 'policy_id' => 'string', - 'cycle_id' => 'string', - 'cycle_desc' => 'string', - 'sequence_number' => 'int', - 'where_clause' => 'string', - 'break_key' => 'string', - 'validation_mode' => 'string', - ); -$SOAP_dispatch_map['cycleSave'] = array( - 'in' => array('cycle' => '{urn:MaarchSoapServer}lcCycles', 'mode' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "modules/life_cycle#lc_cycles::save", - ); -$SOAP_dispatch_map['cycleDelete'] = array( - 'in' => array('cycle' => '{urn:MaarchSoapServer}lcCycles'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "modules/life_cycle#lc_cycles::delete", - ); -$SOAP_dispatch_map['cycleGet'] = array( - 'in' => array('cycleId' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}lcCycles'), - 'method' => "modules/life_cycle#lc_cycles::getWs", - ); -/**************************************************************************************************/ -// LC_CYCLE_STEPS -$SOAP_typedef['lcCycleSteps'] = array( 'policy_id' => 'string', - 'cycle_id' => 'string', - 'cycle_step_id' => 'string', - 'cycle_step_desc' => 'string', - 'docserver_type_id' => 'string', - //'is_allow_failure' => 'boolean', - 'step_operation' => 'string', - 'sequence_number' => 'int', - //'is_must_complete' => 'boolean', - 'preprocess_script' => 'string', - 'postprocess_script' => 'string', - ); -$SOAP_dispatch_map['cycleStepSave'] = array( - 'in' => array('cycleStep' => '{urn:MaarchSoapServer}lcCycleSteps', 'mode' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "modules/life_cycle#lc_cycle_steps::save", - ); -$SOAP_dispatch_map['cycleStepDelete'] = array( - 'in' => array('cycleStep' => '{urn:MaarchSoapServer}lcCycleSteps'), - 'out' => array('out' => '{urn:MaarchSoapServer}returnArray'), - 'method' => "modules/life_cycle#lc_cycle_steps::delete", - ); -$SOAP_dispatch_map['cycleStepGet'] = array( - 'in' => array('cycleStepId' => 'string'), - 'out' => array('out' => '{urn:MaarchSoapServer}lcCycleSteps'), - 'method' => "modules/life_cycle#lc_cycle_steps::getWs", - ); + diff --git a/modules/notes/class/class_modules_tools_Abstract.php b/modules/notes/class/class_modules_tools_Abstract.php index 851fee1823145ef1b82a2592f72fee9d57235371..5b261c3060ea07cbe96c45a0dc04179183506372 100755 --- a/modules/notes/class/class_modules_tools_Abstract.php +++ b/modules/notes/class/class_modules_tools_Abstract.php @@ -216,6 +216,9 @@ abstract class notes_Abstract $query = "SELECT id FROM ".NOTE_ENTITIES_TABLE." WHERE note_id = ?"; $stmt2 = $db->query($query, array($res->id)); + + $stmt3 = $db->query("SELECT id FROM USERS WHERE user_id = ?", array($_SESSION['user']['UserId'])); + $userInfo = $stmt3->fetchObject(); if($stmt2->rowCount()==0) { array_push($userNotes, @@ -230,7 +233,7 @@ abstract class notes_Abstract . "select note_id from ". NOTE_ENTITIES_TABLE. " where (item_id in (" ."SELECT entity_id FROM users_entities WHERE user_id = ?) and note_id = ?))" . "or (id = ? and user_id = ?)", - array($_SESSION['user']['UserId'], $res->id, $res->id, $_SESSION['user']['UserId'])); + array($userInfo->id, $res->id, $res->id, $userInfo->id)); if($stmt2->rowCount()<>0) { array_push($userNotes, diff --git a/modules/notes/notes.php b/modules/notes/notes.php index ceb7ba7853edc46b34c6aa79a470ae68bd7fccbc..03b859e38dcc1a0400924276039733931188f536 100755 --- a/modules/notes/notes.php +++ b/modules/notes/notes.php @@ -130,9 +130,13 @@ if (isset($_REQUEST['load'])) { $userEntities = array_column($rawUserEntities, 'entity_id'); $userEntities = !empty($userEntities) ? $userEntities : ['']; + $db = new Database(); + $stmt3 = $db->query("SELECT id FROM USERS WHERE user_id = ?", array($_SESSION['user']['UserId'])); + $userInfo = $stmt3->fetchObject(); + $where_tab[] = "identifier = ?"; $where_tab[] = "type = ?"; - $where_tab[] = "notes.id in (select notes.id from notes left join note_entities on notes.id = note_entities.note_id where item_id IS NULL OR item_id in (?) or notes.user_id = '".$_SESSION['user']['UserId']."')"; + $where_tab[] = "notes.id in (select notes.id from notes left join note_entities on notes.id = note_entities.note_id where item_id IS NULL OR item_id in (?) or notes.user_id = ".$userInfo->id.")"; $arrayPDO = array($identifier); $arrayPDO[] = 'resource'; $arrayPDO[] = $userEntities; @@ -161,22 +165,22 @@ if (isset($_REQUEST['load'])) { } //Request - $tabNotes=$request->PDOselect( - $select, - $where, - $arrayPDO, - $orderstr, - $_SESSION['config']['databasetype'], - "default", - true, - NOTES_TABLE, - USERS_TABLE, - "user_id", - true, - false, - false, - $start - ); + // $tabNotes=$request->PDOselect( + // $select, + // $where, + // $arrayPDO, + // $orderstr, + // $_SESSION['config']['databasetype'], + // "default", + // true, + // NOTES_TABLE, + // USERS_TABLE, + // "user_id", + // true, + // false, + // false, + // $start + // ); // $request->show_array($tabNotes); for ($indNotes1 = 0; $indNotes1 < count($tabNotes); $indNotes1 ++) { diff --git a/modules/notifications/batch/config/config.xml.default b/modules/notifications/batch/config/config.xml.default index 4e1bf5e1ccf68b8209a4773cea35a948df431be2..fbd7e26106052987ff5a6db1b91f17336788a546 100755 --- a/modules/notifications/batch/config/config.xml.default +++ b/modules/notifications/batch/config/config.xml.default @@ -21,7 +21,6 @@ <Table>res_letterbox</Table> <View>res_view_letterbox</View> <Adr>adr_letterbox</Adr> - <Extension>mlb_coll_ext</Extension> </COLLECTION> <CONFIG_BASE> <databaseserver>127.0.0.1</databaseserver> diff --git a/modules/notifications/batch/load_stack_letterbox_alerts.php b/modules/notifications/batch/load_stack_letterbox_alerts.php index 5a61a77e1581b1c478f52a1628ada8086eafd84f..e4e4012b4a2fd6fd59df36c5ab9780aef50be6d1 100755 --- a/modules/notifications/batch/load_stack_letterbox_alerts.php +++ b/modules/notifications/batch/load_stack_letterbox_alerts.php @@ -180,7 +180,6 @@ if ((string) $log4phpParams->enabled == 'true') { // COLLECTION $collParams = $xmlconfig->COLLECTION; $collTable = (string)$collParams->Table; -$collExt = (string)$collParams->Extension; $collView = (string)$collParams->View; diff --git a/modules/notifications/batch/stack_letterbox_alerts.php b/modules/notifications/batch/stack_letterbox_alerts.php index 6a047e459d31ee773709ddb677a5ab0399489304..76c35b0c026574eaa1040fa0bbfb189424338aad 100755 --- a/modules/notifications/batch/stack_letterbox_alerts.php +++ b/modules/notifications/batch/stack_letterbox_alerts.php @@ -124,8 +124,7 @@ while ($state <> 'END') { Bt_doQuery($db, $query); } } - $query = "UPDATE " . $collExt - . " SET flag_alarm1 = 'Y', alarm1_date = " . $db->current_datetime() + $query = "UPDATE res_letterbox SET flag_alarm1 = 'Y', alarm1_date = " . $db->current_datetime() . " WHERE res_id = " . $myDoc->res_id; Bt_doQuery($db, $query); } @@ -152,8 +151,7 @@ while ($state <> 'END') { Bt_doQuery($db, $query); } } - $query = "UPDATE " . $collExt - . " SET flag_alarm1 = 'Y', flag_alarm2 = 'Y', alarm2_date = " . $db->current_datetime() + $query = "UPDATE res_letterbox SET flag_alarm1 = 'Y', flag_alarm2 = 'Y', alarm2_date = " . $db->current_datetime() . " WHERE res_id = " . $myDoc->res_id; Bt_doQuery($db, $query); } diff --git a/modules/notifications/class/class_modules_tools_Abstract.php b/modules/notifications/class/class_modules_tools_Abstract.php index cad018e91d2c12506a1acd26d890a95e7a167651..532988778d10c80491aa9dfb4d6a37f020729f52 100755 --- a/modules/notifications/class/class_modules_tools_Abstract.php +++ b/modules/notifications/class/class_modules_tools_Abstract.php @@ -70,12 +70,6 @@ abstract class notifications_Abstract { "table" => utf8_decode((string) $COLLECTION->table), "view" => utf8_decode((string) $COLLECTION->view) ); - $j=0; - foreach($COLLECTION->extensions as $EXTENSIONS) - { - $_SESSION['collection'][$i]['extensions'][$j] = utf8_decode((string) $EXTENSIONS->table); - $j++; - } $i++; } diff --git a/modules/reports/reports.php b/modules/reports/reports.php index 014a33a78c1604cf4dc26e77d942ab3a94b95a82..b068974c131977608e3dc76314b7e6445f05d463 100755 --- a/modules/reports/reports.php +++ b/modules/reports/reports.php @@ -36,10 +36,7 @@ $rep->manage_location_bar($pagePath, $pageLabel, $pageId, $init, $level); // RETRIEVE NB OF DOCUMENTS $stmt = $db->query( - 'select count(1) as total from '.$_SESSION['collections'][0]['view'] - .' inner join mlb_coll_ext on '.$_SESSION['collections'][0]['view'] - .'.res_id = mlb_coll_ext.res_id where '.$_SESSION['collections'][0]['view'] - .".status not in ('DEL','BAD')" + "select count(1) as total from ".$_SESSION['collections'][0]['view']." where status not in ('DEL','BAD')" ); // RETRIEVE NB OF FOLDERS diff --git a/modules/sendmail/Controllers/ReceiveMessageExchangeController.php b/modules/sendmail/Controllers/ReceiveMessageExchangeController.php index cf62c1ddcd9d2f6b2e743c4f93e6dd4dca59ac6f..bace7ed15bf75c60284a4a55c9e085d2ea1f19af 100755 --- a/modules/sendmail/Controllers/ReceiveMessageExchangeController.php +++ b/modules/sendmail/Controllers/ReceiveMessageExchangeController.php @@ -76,14 +76,6 @@ class ReceiveMessageExchangeController $aDefaultConfig = self::readXmlConfig(); - /*************** RES LETTERBOX **************/ - $this->addComment('['.date("d/m/Y H:i:s") . '] Enregistrement du message'); - $resLetterboxReturn = self::saveResLetterbox(["dataObject" => $sDataObject, "defaultConfig" => $aDefaultConfig]); - - if (!empty($resLetterboxReturn['errors'])) { - return $response->withStatus(400)->withJson(["errors" => $resLetterboxReturn['errors']]); - } - /*************** CONTACT **************/ $this->addComment('['.date("d/m/Y H:i:s") . '] Selection ou création du contact'); $contactReturn = self::saveContact(["dataObject" => $sDataObject, "defaultConfig" => $aDefaultConfig]); @@ -93,12 +85,14 @@ class ReceiveMessageExchangeController } self::$aComments[] = '['.date("d/m/Y H:i:s") . '] Contact sélectionné ou créé'; - /************** MLB COLL EXT **************/ - $return = self::saveExtensionTable(["contact" => $contactReturn, "resId" => $resLetterboxReturn]); + /*************** RES LETTERBOX **************/ + $this->addComment('['.date("d/m/Y H:i:s") . '] Enregistrement du message'); + $resLetterboxReturn = self::saveResLetterbox(["dataObject" => $sDataObject, "defaultConfig" => $aDefaultConfig, "contact" => $contactReturn]); - if (!empty($return['errors'])) { - return $response->withStatus(400)->withJson(["errors" => $return['errors']]); + if (!empty($resLetterboxReturn['errors'])) { + return $response->withStatus(400)->withJson(["errors" => $resLetterboxReturn['errors']]); } + self::$aComments[] = '['.date("d/m/Y H:i:s") . '] Message enregistré'; /************** NOTES *****************/ $notesReturn = self::saveNotes(["dataObject" => $sDataObject, "resId" => $resLetterboxReturn, "userId" => $GLOBALS['id']]); @@ -249,28 +243,30 @@ class ReceiveMessageExchangeController $destUser = UserModel::getByEmail(['mail' => $email]); } + $contact = $aArgs['contact']; + $dataValue = []; - array_push($dataValue, ['column' => 'typist', 'value' => 'superadmin', 'type' => 'string']); - array_push($dataValue, ['column' => 'type_id', 'value' => $defaultConfig['type_id'], 'type' => 'integer']); - array_push($dataValue, ['column' => 'subject', 'value' => str_replace("[CAPTUREM2M]", "", $mainDocumentMetaData->Title[0]), 'type' => 'string']); - array_push($dataValue, ['column' => 'doc_date', 'value' => $mainDocumentMetaData->CreatedDate, 'type' => 'date']); - array_push($dataValue, ['column' => 'destination', 'value' => $destination[0]['entity_id'], 'type' => 'string']); - array_push($dataValue, ['column' => 'initiator', 'value' => $destination[0]['entity_id'], 'type' => 'string']); - array_push($dataValue, ['column' => 'dest_user', 'value' => $destUser[0]['user_id'], 'type' => 'string']); - array_push($dataValue, ['column' => 'reference_number', 'value' => $dataObject->MessageIdentifier->value, 'type' => 'string']); - array_push($dataValue, ['column' => 'priority', 'value' => $defaultConfig['priority'], 'type' => 'integer']); - array_push($dataValue, ['column' => 'confidentiality', 'value' => 'N', 'type' => 'string']); - - $allDatas = [ - "encodedFile" => $documentMetaData->Attachment->value, - "data" => $dataValue, - "collId" => "letterbox_coll", - "table" => "res_letterbox", - "fileFormat" => $fileFormat, - "status" => $defaultConfig['status'] - ]; - - return StoreController::storeResourceRes($allDatas); + array_push($dataValue, ['typist' => 'superadmin']); + array_push($dataValue, ['type_id' => $defaultConfig['type_id']]); + array_push($dataValue, ['subject' => str_replace("[CAPTUREM2M]", "", $mainDocumentMetaData->Title[0])]); + array_push($dataValue, ['doc_date' => $mainDocumentMetaData->CreatedDate]); + array_push($dataValue, ['destination' => $destination[0]['entity_id']]); + array_push($dataValue, ['initiator' => $destination[0]['entity_id']]); + array_push($dataValue, ['dest_user' => $destUser[0]['user_id']]); + array_push($dataValue, ['reference_number' => $dataObject->MessageIdentifier->value]); + array_push($dataValue, ['priority' => $defaultConfig['priority']]); + array_push($dataValue, ['confidentiality' => 'N']); + // array_push($dataValue, ['nature_id' => 'message_exchange'); + array_push($dataValue, ['category_id' => 'incoming']); + array_push($dataValue, ['alt_identifier' => '']); + array_push($dataValue, ['exp_contact_id' => $contact['contactId']]); + array_push($dataValue, ['address_id' => $contact['addressId']]); + array_push($dataValue, ['admission_date' => 'CURRENT_TIMESTAMP']); + array_push($dataValue, ['encodedFile' => $documentMetaData->Attachment->value]); + array_push($dataValue, ['fileFormat' => $fileFormat]); + array_push($dataValue, ['status' => $defaultConfig['status']]); + + return StoreController::storeResource($dataValue); } protected static function saveContact($aArgs = []) @@ -325,25 +321,6 @@ class ReceiveMessageExchangeController return $contact; } - protected static function saveExtensionTable($aArgs = []) - { - $contact = $aArgs['contact']; - - $dataValue = []; - array_push($dataValue, ['column' => 'nature_id', 'value' => 'message_exchange', 'type' => 'string']); - array_push($dataValue, ['column' => 'category_id', 'value' => 'incoming', 'type' => 'string']); - array_push($dataValue, ['column' => 'alt_identifier', 'value' => '', 'type' => 'string']); - array_push($dataValue, ['column' => 'exp_contact_id', 'value' => $contact['contactId'], 'type' => 'integer']); - array_push($dataValue, ['column' => 'address_id', 'value' => $contact['addressId'], 'type' => 'integer']); - array_push($dataValue, ['column' => 'admission_date', 'value' => 'CURRENT_TIMESTAMP', 'type' => 'date']); - - $formatedData = StoreController::prepareExtStorage(['resId' => $aArgs['resId'], 'data' => $dataValue]); - //mlb_coll_ext - $return = ResModel::createExt($formatedData); - - return $return; - } - protected static function saveNotes($aArgs = []) { $countNote = 0; @@ -396,20 +373,18 @@ class ReceiveMessageExchangeController array_push($dataValue, ['column' => 'attachment_type', 'value' => $defaultConfig['attachment_type'], 'type' => 'string']); array_push($dataValue, ['column' => 'relation', 'value' => '1', 'type' => 'integer']); array_push($dataValue, ['column' => 'coll_id', 'value' => 'letterbox_coll', 'type' => 'string']); - array_push($dataValue, ['column' => 'doc_date', 'value' => $attachmentContent->CreatedDate, 'type' => 'date']); array_push($dataValue, ['column' => 'title', 'value' => $attachmentContent->Title[0], 'type' => 'string']); $allDatas = [ "encodedFile" => $BinaryDataObjectInfo->Attachment->value, "data" => $dataValue, - "collId" => "letterbox_coll", - "table" => "res_attachments", + "version" => false, "fileFormat" => $fileFormat, "status" => 'TRA' ]; - $resId = StoreController::storeResourceRes($allDatas); + $resId = StoreController::storeAttachment($allDatas); $countAttachment++; } } diff --git a/modules/sendmail/mail_form.php b/modules/sendmail/mail_form.php index ba5a59132f3b0f9fdece0fd9cd19eed3a6adccc1..669048bed6150b138fbae496ecbaa6bb74cbfb95 100755 --- a/modules/sendmail/mail_form.php +++ b/modules/sendmail/mail_form.php @@ -228,7 +228,7 @@ if ($mode == 'add') { $dest_contact_id = null; $db = new Database(); $stmt = $db->query('SELECT res_id, category_id, address_id, exp_user_id, dest_user_id, admission_date, exp_contact_id, dest_contact_id - FROM mlb_coll_ext + FROM res_letterbox WHERE (( exp_contact_id is not null or dest_contact_id is not null or exp_user_id is not null diff --git a/modules/sendmail/mail_form_to_contact.php b/modules/sendmail/mail_form_to_contact.php index 5019e3dcf33adecc0040962841e1d018b0078613..9428e54b3035b7316dbf288d70603677b2270779 100755 --- a/modules/sendmail/mail_form_to_contact.php +++ b/modules/sendmail/mail_form_to_contact.php @@ -198,7 +198,7 @@ if ($mode == 'add') { $adresse_mail = null; $db = new Database(); $stmt = $db->query('SELECT res_id, category_id, address_id, exp_user_id, dest_user_id, admission_date - FROM mlb_coll_ext + FROM res_letterbox WHERE (( exp_contact_id is not null or dest_contact_id is not null or exp_user_id is not null