Skip to content
Snippets Groups Projects
Commit 518849b1 authored by Henri Queneau's avatar Henri Queneau
Browse files

FIX #5424 fix editing on visa

parent 9e5abb44
No related branches found
No related tags found
No related merge requests found
...@@ -1219,6 +1219,7 @@ if (isset($_POST['add']) && $_POST['add']) { ...@@ -1219,6 +1219,7 @@ if (isset($_POST['add']) && $_POST['add']) {
$OriginalHash = $res->fingerprint; $OriginalHash = $res->fingerprint;
if ($_SESSION['upfile']['upAttachment'] && $OriginalHash <> $NewHash) { if ($_SESSION['upfile']['upAttachment'] && $OriginalHash <> $NewHash) {
$_SESSION['upfile']['upAttachment'] = false;
$fileInfos = array( $fileInfos = array(
"tmpDir" => $_SESSION['config']['tmppath'], "tmpDir" => $_SESSION['config']['tmppath'],
"size" => $_SESSION['upfile']['size'], "size" => $_SESSION['upfile']['size'],
...@@ -1875,7 +1876,7 @@ if(!isset($_REQUEST['id'])) { ...@@ -1875,7 +1876,7 @@ if(!isset($_REQUEST['id'])) {
. '\', \'\', \'height=200, width=250,scrollbars=no,resizable=no,directories=no,toolbar=no\');$(\'add\').value=\'Edition en cours ...\';setInterval(function() {checkEditingDoc(\''.$_SESSION['user']['UserId'].'\')}, 500);$(\'add\').disabled=\'disabled\';$(\'add\').style.opacity=\'0.5\';this.hide();"/>';*/ . '\', \'\', \'height=200, width=250,scrollbars=no,resizable=no,directories=no,toolbar=no\');$(\'add\').value=\'Edition en cours ...\';setInterval(function() {checkEditingDoc(\''.$_SESSION['user']['UserId'].'\')}, 500);$(\'add\').disabled=\'disabled\';$(\'add\').style.opacity=\'0.5\';this.hide();"/>';*/
$content .= '" name="edit" id="edit" style="display:none;margin-top: 0" class="button" ' $content .= '" name="edit" id="edit" style="display:none;margin-top: 0" class="button" '
. 'onclick="showAppletLauncher(\'' . $_SESSION['config']['businessappurl'] . 'index.php?display=true&module=content_management&page=applet_modal_launcher&objectType=attachmentVersion&objectId=\'+$(\'templateOffice\').value+\'&attachType=\'+$(\'attachment_types\').value+\'&objectTable=' . $objectTable . '&contactId=\'+$(\'contactidAttach\').value+\'&addressId=\'+$(\'addressidAttach\').value+\'&chronoAttachment=\'+$(\'chrono\').value+\'&titleAttachment=\'+cleanTitle($(\'title\').value)+\'&back_date=\'+$(\'back_date\').value+\'&resMaster=' . $_SESSION['doc_id'] . 'onclick="showAppletLauncher(\'' . $_SESSION['config']['businessappurl'] . 'index.php?display=true&module=content_management&page=applet_modal_launcher&objectType=attachmentVersion&objectId=\'+$(\'templateOffice\').value+\'&attachType=\'+$(\'attachment_types\').value+\'&objectTable=' . $objectTable . '&contactId=\'+$(\'contactidAttach\').value+\'&addressId=\'+$(\'addressidAttach\').value+\'&chronoAttachment=\'+$(\'chrono\').value+\'&titleAttachment=\'+cleanTitle($(\'title\').value)+\'&back_date=\'+$(\'back_date\').value+\'&resMaster=' . $_SESSION['doc_id']
. '\', \'100px\', \'500px\');$(\'add\').value=\'Edition en cours ...\';setInterval(function() {checkEditingDoc(\''.$_SESSION['user']['UserId'].'\')}, 500);$(\'add\').disabled=\'disabled\';$(\'add\').style.opacity=\'0.5\';this.hide();"/>'; . '\', \'100px\', \'500px\');$(\'add\').value=\'Edition en cours ...\';editingDoc(\''.$_SESSION['user']['UserId'].'\');$(\'add\').disabled=\'disabled\';$(\'add\').style.opacity=\'0.5\';this.hide();"/>';
$content .= '<span style="display: none" id="divOr0">&nbsp;ou&nbsp;</span>'; $content .= '<span style="display: none" id="divOr0">&nbsp;ou&nbsp;</span>';
$content .= '</div>'; $content .= '</div>';
...@@ -1909,7 +1910,7 @@ $content .= '</div>'; ...@@ -1909,7 +1910,7 @@ $content .= '</div>';
.'\', \'\', \'height=200, width=250,scrollbars=no,resizable=no,directories=no,toolbar=no\');$(\'edit\').value=\'Edition en cours ...\';setInterval(function() {checkEditingDoc(\''.$_SESSION['user']['UserId'].'\')}, 500);$(\'edit\').disabled=\'disabled\';$(\'edit\').style.opacity=\'0.5\';this.hide();"/>';*/ .'\', \'\', \'height=200, width=250,scrollbars=no,resizable=no,directories=no,toolbar=no\');$(\'edit\').value=\'Edition en cours ...\';setInterval(function() {checkEditingDoc(\''.$_SESSION['user']['UserId'].'\')}, 500);$(\'edit\').disabled=\'disabled\';$(\'edit\').style.opacity=\'0.5\';this.hide();"/>';*/
$content .= '" name="editModel" id="editModel" class="button" onclick="$(\'hiddenValidateStatus\').value=\'2\';$(\'edit\').style.visibility=\'visible\';showAppletLauncher(\'' $content .= '" name="editModel" id="editModel" class="button" onclick="$(\'hiddenValidateStatus\').value=\'2\';$(\'edit\').style.visibility=\'visible\';showAppletLauncher(\''
. $_SESSION['config']['businessappurl'] . 'index.php?display=true&module=content_management&page=applet_modal_launcher&objectType=attachmentUpVersion&objectId='.$_REQUEST['id'].'&contactId=\'+$(\'contactidAttach\').value+\'&addressId=\'+$(\'addressidAttach\').value+\'&titleAttachment=\'+cleanTitle($(\'title\').value)+\'&back_date=\'+$(\'back_date\').value+\'&objectTable=res_view_attachments&resMaster='.$_SESSION['doc_id'] . $_SESSION['config']['businessappurl'] . 'index.php?display=true&module=content_management&page=applet_modal_launcher&objectType=attachmentUpVersion&objectId='.$_REQUEST['id'].'&contactId=\'+$(\'contactidAttach\').value+\'&addressId=\'+$(\'addressidAttach\').value+\'&titleAttachment=\'+cleanTitle($(\'title\').value)+\'&back_date=\'+$(\'back_date\').value+\'&objectTable=res_view_attachments&resMaster='.$_SESSION['doc_id']
.'\', \'\', \'height=200, width=250,scrollbars=no,resizable=no,directories=no,toolbar=no\');$(\'edit\').value=\'Edition en cours ...\';setInterval(function() {checkEditingDoc(\''.$_SESSION['user']['UserId'].'\')}, 500);$(\'edit\').disabled=\'disabled\';$(\'edit\').style.opacity=\'0.5\';this.hide();"/>'; .'\', \'\', \'height=200, width=250,scrollbars=no,resizable=no,directories=no,toolbar=no\');$(\'edit\').value=\'Edition en cours ...\';editingDoc(\''.$_SESSION['user']['UserId'].'\');$(\'edit\').disabled=\'disabled\';$(\'edit\').style.opacity=\'0.5\';this.hide();"/>';
} /*else { } /*else {
$content .= '" name="edit" id="edit" style="display:none" class="button" ' $content .= '" name="edit" id="edit" style="display:none" class="button" '
.'onclick="window.open(\''. $_SESSION['config']['businessappurl'] . 'index.php?display=true&module=content_management&page=applet_popup_launcher&objectType=attachmentVersion&objectId=\'+$(\'templateOffice\').value+\'&objectTable='. $objectTable .'&contactId=\'+$(\'contactidAttach\').value+\'&chronoAttachment=\'+$(\'chrono\').value+\'&resMaster='.$_SESSION['doc_id'] .'onclick="window.open(\''. $_SESSION['config']['businessappurl'] . 'index.php?display=true&module=content_management&page=applet_popup_launcher&objectType=attachmentVersion&objectId=\'+$(\'templateOffice\').value+\'&objectTable='. $objectTable .'&contactId=\'+$(\'contactidAttach\').value+\'&chronoAttachment=\'+$(\'chrono\').value+\'&resMaster='.$_SESSION['doc_id']
......
var editing;
function editingDoc(user){
editing = setInterval(function() {checkEditingDoc('user')}, 500);
}
//load applet in a modal //load applet in a modal
function loadApplet(url, value) function loadApplet(url, value)
{ {
...@@ -52,6 +58,7 @@ function sendAppletMsg(theMsg) ...@@ -52,6 +58,7 @@ function sendAppletMsg(theMsg)
//destroy the modal of the applet and launch an ajax script //destroy the modal of the applet and launch an ajax script
function endOfApplet(objectType, theMsg) function endOfApplet(objectType, theMsg)
{ {
console.log('endOfAppletendOfAppletendOfApplet');
if (window.opener.$('add')) { if (window.opener.$('add')) {
window.opener.$('add').setStyle({display: 'inline'}); window.opener.$('add').setStyle({display: 'inline'});
} else if (window.opener.$('edit')) { } else if (window.opener.$('edit')) {
...@@ -213,6 +220,8 @@ function checkEditingDoc(userId) { ...@@ -213,6 +220,8 @@ function checkEditingDoc(userId) {
target.removeAttribute('disabled'); target.removeAttribute('disabled');
target.style.opacity='1'; target.style.opacity='1';
target.value='Valider'; target.value='Valider';
console.log('clearInterval');
clearInterval(editing);
} else { } else {
console.log('lck found! Editing in progress !'); console.log('lck found! Editing in progress !');
target.disabled='disabled'; target.disabled='disabled';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment