diff --git a/apps/maarch_entreprise/js/functions.js b/apps/maarch_entreprise/js/functions.js index 4d62e85091f01d5a05baf7e9bdf6a2e35f85f842..56fec8b213089e53cb0133e639b24bfb9aa5860c 100755 --- a/apps/maarch_entreprise/js/functions.js +++ b/apps/maarch_entreprise/js/functions.js @@ -3907,4 +3907,10 @@ function openSenderInfoContact(id, type) { } window.open('index.php?display=true&dir=my_contacts&page=info_contact_iframe&mode=editDetailSender&editDetailSender&popup&sender_recipient_id='+id+'&sender_recipient_type='+type, 'contact_info', 'height='+height+', width=1000,scrollbars=yes,resizable=yes'); } -} \ No newline at end of file +} + +function displayAddMailing() { + if ($j("#mailingInfo").is(":visible")) { + $j("#addMailing").show(); + } +} diff --git a/modules/attachments/attachments_content.php b/modules/attachments/attachments_content.php index e2712138ddd90140d6b5e43f062ea8e5ce9ce7a8..9610e4236c8175256ff6073e04e9290205542b45 100755 --- a/modules/attachments/attachments_content.php +++ b/modules/attachments/attachments_content.php @@ -1046,7 +1046,10 @@ if (isset($_POST['add']) && $_POST['add']) { 'typist', 'format', 'status', 'title', 'attachment_type', 'in_signature_book', 'res_id_master', 'validation_date', 'effective_date', 'identifier', 'docserver_id', 'path', 'filename' ]; - if ($is_new_version) { + if ($is_new_version || $_REQUEST['relation'] != 1) { + if ($_REQUEST['relation'] != 1) { + $id = $_REQUEST['res_id']; + } $attachmentToProcess = \Attachment\models\AttachmentModel::getById([ 'select' => $select, 'id' => $id, @@ -1497,7 +1500,7 @@ $content .= '<div class="transmissionDiv" id="addAttach1">'; //FILE if ($mode == 'add') { $content .= '<p>'; - $content .= '<label id="file_label">'._FILE.' <span id="templateOfficeTool"><i class="fa fa-paperclip fa-lg" title="'._LOADED_FILE.'" style="cursor:pointer;" id="attachment_type_icon" onclick="$j(\'#add\').css(\'display\', \'inline\');$(\'attachment_type_icon\').setStyle({color: \'#135F7F\'});$(\'attachment_type_icon2\').setStyle({color: \'#666\'});$(\'templateOffice\').setStyle({display: \'none\'});$(\'templateOffice\').disabled=true;$(\'templateOffice_edit\').setStyle({display: \'none\'});$(\'choose_file\').setStyle({display: \'inline-block\'});document.getElementById(\'choose_file\').contentDocument.getElementById(\'file\').click();"></i> <i class="fa fa-file-alt fa-lg" title="'._GENERATED_FILE.'" style="cursor:pointer;color:#135F7F;" id="attachment_type_icon2" onclick="$(\'attachment_type_icon2\').setStyle({color: \'#135F7F\'});$(\'attachment_type_icon\').setStyle({color: \'#666\'});$(\'templateOffice\').setStyle({display: \'inline-block\'});$(\'templateOffice\').disabled=false;$(\'choose_file\').setStyle({display: \'none\'});"></i></span></label>'; + $content .= '<label id="file_label">'._FILE.' <span id="templateOfficeTool"><i class="fa fa-paperclip fa-lg" title="'._LOADED_FILE.'" style="cursor:pointer;" id="attachment_type_icon" onclick="$j(\'#add\').css(\'display\', \'inline\');$(\'attachment_type_icon\').setStyle({color: \'#135F7F\'});$(\'attachment_type_icon2\').setStyle({color: \'#666\'});$(\'templateOffice\').setStyle({display: \'none\'});$(\'templateOffice\').disabled=true;$(\'templateOffice_edit\').setStyle({display: \'none\'});$(\'choose_file\').setStyle({display: \'inline-block\'});document.getElementById(\'choose_file\').contentDocument.getElementById(\'file\').click();displayAddMailing()"></i> <i class="fa fa-file-alt fa-lg" title="'._GENERATED_FILE.'" style="cursor:pointer;color:#135F7F;" id="attachment_type_icon2" onclick="$(\'attachment_type_icon2\').setStyle({color: \'#135F7F\'});$(\'attachment_type_icon\').setStyle({color: \'#666\'});$(\'templateOffice\').setStyle({display: \'inline-block\'});$(\'templateOffice\').disabled=false;$(\'choose_file\').setStyle({display: \'none\'});"></i></span></label>'; $content .= '<select name="templateOffice[]" id="templateOffice" style="display:inline-block;" onchange="showEditButton(this);">'; $content .= '<option value="">'._CHOOSE_MODEL.'</option>';