Skip to content

Commit

Permalink
Merge pull request #725 from EquinoxOpenLibraryInitiative/ERM-63-mode…
Browse files Browse the repository at this point in the history
…rn-jquery-update-with-php8-fixes-WIP

Erm 63 modern jquery update with php8 fixes wip
  • Loading branch information
Randall Rupper authored May 22, 2023
2 parents 9bd0a30 + de07ba9 commit 8e6495a
Show file tree
Hide file tree
Showing 20 changed files with 84 additions and 62 deletions.
6 changes: 3 additions & 3 deletions auth/ajax_htmldata.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@
echo "<tr>";
echo "<td>" . $userArray['loginID'] . "</td>";
echo "<td>" . $isAdmin . "</td>";
echo "<td><a href='ajax_forms.php?action=getAdminUserUpdateForm&loginID=" . $userArray['loginID'] . "&height=230&width=315&modal=true' class='thickbox'><img src='images/edit.gif' alt='"._("edit password or admin status")."' title='"._("edit password or admin status")."'></a></td>";
echo "<td><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getAdminUserUpdateForm&loginID=" . $userArray['loginID'] . "&height=230&width=315&modal=true\",400,350)' class='thickbox'><img src='images/edit.gif' alt='"._("edit password or admin status")."' title='"._("edit password or admin status")."'></a></td>";
echo "<td><a href='javascript:void(0);' class='deleteUser' id='" . $userArray['loginID'] . "'><img src='images/cross.gif' alt='"._("remove")."' title='"._("remove")."'></a></td>";
echo "</tr>";
}

?>
</table>
<a href='ajax_forms.php?action=getAdminUserUpdateForm&loginID=&height=215&width=315&modal=true' class='thickbox' id='addUser'><?php echo _("add new user")?></a>
<a href='javascript:void(0)' onclick='javascript:myDialog("ajax_forms.php?action=getAdminUserUpdateForm&loginID=&height=215&width=315&modal=true",400,350)' class='thickbox' id='addUser'><?php echo _("add new user")?></a>
<?php

}else{
echo "(none found)<br /><a href='ajax_forms.php?action=getUserUpdateForm&loginID=&height=275&width=315&modal=true' class='thickbox' id='addUser'>"._("add new user")."</a>";
echo "(none found)<br /><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getUserUpdateForm&loginID=&height=275&width=315&modal=true\",300,350)' class='thickbox' id='addUser'>"._("add new user")."</a>";
}

break;
Expand Down
25 changes: 25 additions & 0 deletions auth/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,28 @@ function postwith (to,p) {
myForm.submit() ;
document.body.removeChild(myForm) ;
}


function myDialog(loadForm, h,w){
$('<div/>').dialog({
modal: true,
open: function ()
{
if ($(this).is(':empty')) {
$(this).load(loadForm);
}
},
height: h,
width: w,
// title:"JQuery Dialog"
dialogClass: "no-titlebar"
});
}

function myCloseDialog(){
//$(this).dialog('close')
//$(this).closest('.ui-dialog-content').dialog('close');
// $(formName).dialog( "close" )
$('.ui-dialog-content').dialog('destroy');
}

18 changes: 3 additions & 15 deletions licensing/ajax_htmldata.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<?php

if ($user->canEdit()){?>
<!-- <a href='ajax_forms.php?action=getLicenseForm&licenseID=<?php echo $licenseID; ?>&height=260&width=260&modal=true' class='thickbox'><?php echo _("edit license");?></a> | <a href='javascript:deleteLicense("<?php echo $licenseID; ?>");'><?php echo _("remove license");?></a> -->
<a href='javascript:void(0)' onclick='javascript:myDialog("ajax_forms.php?action=getLicenseForm&licenseID=<?php echo $licenseID; ?>",260,280)' class='thickbox'><?php echo _("edit license");?></a> | <a href='javascript:deleteLicense("<?php echo $licenseID; ?>");'><?php echo _("remove license");?></a>
<?php }

Expand Down Expand Up @@ -139,7 +138,6 @@
echo "<tr>";
echo "<td>" . $document->shortName . "</td>";
echo "<td>" . $sfxProvider->shortName . "</td>";
// echo "<td class='icon'><a href='ajax_forms.php?action=getSFXForm&height=178&width=260&modal=true&licenseID=" . $licenseID . "&providerID=" . $sfxProvider->sfxProviderID . "' class='thickbox' id='editSFXProvider'><img id='Edit' class='icon' src='images/edit.gif' title= '"._("Edit")."' /></a></td>";
echo "<td class='icon'><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getSFXForm&licenseID=" . $licenseID . "&providerID=" . $sfxProvider->sfxProviderID . "\",210,300)' class='thickbox' id='editSFXProvider'><img id='Edit' class='icon' src='images/edit.gif' title= '"._("Edit")."' /></a></td>";
echo "<td class='icon'><a href='javascript:deleteSFXProvider(\"" . $sfxProvider->sfxProviderID . "\");'><img id='Remove' src='images/cross.gif' title= '"._("Remove")."' /></a></td>";
echo "</tr>";
Expand All @@ -158,7 +156,6 @@
}

if ($user->canEdit()){
// echo "<br /><br /><a href='ajax_forms.php?action=getSFXForm&licenseID=" . $licenseID . "&height=178&width=260&modal=true' class='thickbox' id='addSFXResource'>"._("add terms tool resource link")."</a>";
echo "<br /><br /><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getSFXForm&licenseID=" . $licenseID . "\", 210, 320)' class='thickbox' id='addSFXResource'>"._("add terms tool resource link")."</a>";

}
Expand Down Expand Up @@ -235,7 +232,6 @@
echo "</td>";

if ($user->canEdit()){
// echo "<td style='text-align: center;'><a href='ajax_forms.php?action=getAttachmentForm&height=398&width=305&modal=true&licenseID=" . $licenseID . "&attachmentID=" . $attachment->attachmentID . "' class='thickbox' id='editAttachment'><img id='Edit' class='AdminEditIcon' src='images/edit.gif' title= '"._("Edit")."' /></a>&nbsp;&nbsp;<a href='javascript:deleteAttachment(\"". $attachment->attachmentID . "\");'><img id='Remove' class='AdminRemoveIcon' src='images/cross.gif' title= '"._("Remove")."' /></a></td>";
echo "<td style='text-align: center;'><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getAttachmentForm&licenseID=" . $licenseID . "&attachmentID=" . $attachment->attachmentID . "\",400, 350)' class='thickbox' id='editAttachment'><img id='Edit' class='AdminEditIcon' src='images/edit.gif' title= '"._("Edit")."' /></a>&nbsp;&nbsp;<a href='javascript:deleteAttachment(\"". $attachment->attachmentID . "\");'><img id='Remove' class='AdminRemoveIcon' src='images/cross.gif' title= '"._("Remove")."' /></a></td>";
}

Expand All @@ -251,7 +247,6 @@
}

if ($user->canEdit()){
// echo "<br /><br /><a href='ajax_forms.php?action=getAttachmentForm&licenseID=" . $licenseID . "&height=380&width=305&modal=true' class='thickbox' id='attachment'>"._("add attachment")."</a>";
echo "<br /><br /><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getAttachmentForm&licenseID=" . $licenseID . "\",400, 350)' class='thickbox' id='attachment'>"._("add attachment")."</a>";

}
Expand Down Expand Up @@ -539,7 +534,6 @@


if ($user->canEdit()){
// echo "\n<td style='text-align:right;width:350px;'><a href='license.php?licenseID=" . $expressionTypeArray['licenseID'] . "' target='_BLANK'>"._("view / edit license")."</a>&nbsp;&nbsp;<a href='ajax_forms.php?action=getExpressionNotesForm&height=330&width=440&modal=true&org=compare&expressionID=" . $expressionTypeArray['expressionID'] . "' class='thickbox' id='ExpressionNotes'>"._("view / edit ") . strtolower($expressionType->noteType) . _(" notes")."</a>&nbsp;&nbsp;<a href='documents/" . $expressionTypeArray['documentURL'] . "' target='_BLANK'>"._("view document")."</a></td></tr></table>";
echo "\n<td style='text-align:right;width:350px;'><a href='license.php?licenseID=" . $expressionTypeArray['licenseID'] . "' target='_BLANK'>"._("view / edit license")."</a>&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getExpressionNotesForm&org=compare&expressionID=" . $expressionTypeArray['expressionID'] . "\", 350,605)' class='thickbox' id='ExpressionNotes'>"._("view / edit ") . strtolower($expressionType->noteType) . _(" notes")."</a>&nbsp;&nbsp;<a href='documents/" . $expressionTypeArray['documentURL'] . "' target='_BLANK'>"._("view document")."</a></td></tr></table>";

}else{
Expand Down Expand Up @@ -853,7 +847,6 @@
}
echo "</table>";
if ($user->canEdit()){
// echo "<a href='ajax_forms.php?action=getSignatureForm&height=270&width=460&modal=true&documentID=" . $document->documentID . "' class='thickbox' id='signatureForm'>"._("add/view details")."</a>";
echo "<a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getSignatureForm&documentID=" . $document->documentID . "\", 280, 585)' class='thickbox' id='signatureForm'>"._("add/view details")."</a>";

}
Expand Down Expand Up @@ -884,7 +877,6 @@
echo "</td>";

if ($user->canEdit()){
// echo "<td class='icon'$classAdd><a href='ajax_forms.php?action=getUploadDocument&height=295&width=317&modal=true&licenseID=" . $licenseID . "&documentID=" . $document->documentID . "' class='thickbox' id='editDocument'><img id='Edit' src='images/edit.gif' title= '"._("Edit")."' /></a> &nbsp &nbsp <a href='javascript:deleteDocument(\"" . $document->documentID . "\");'><img id='Remove' src='images/cross.gif' title= '"._("Remove")."' /></a>";
echo "<td class='icon'$classAdd><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getUploadDocument&licenseID=" . $licenseID . "&documentID=" . $document->documentID . "\", 295,350)' class='thickbox' id='editDocument'><img id='Edit' src='images/edit.gif' title= '"._("Edit")."' /></a> &nbsp &nbsp <a href='javascript:deleteDocument(\"" . $document->documentID . "\");'><img id='Remove' src='images/cross.gif' title= '"._("Remove")."' /></a>";
echo "<br />" . $displayExpirationDate . "</td>";

Expand Down Expand Up @@ -975,14 +967,14 @@
}
echo "</table>";
if ($user->canEdit()){
echo "<a href='ajax_forms.php?action=getSignatureForm&height=270&width=460&modal=true&documentID=" . $childDocument->documentID . "' class='thickbox' id='signatureForm'>"._("add/view details")."</a>";
echo "<a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getSignatureForm&height=270&width=460&modal=true&documentID=" . $childDocument->documentID . "\",300,500)' class='thickbox' id='signatureForm'>"._("add/view details")."</a>";
}


}else{
echo _("(none found)")."<br />";
if ($user->canEdit()){
echo "<a href='ajax_forms.php?action=getSignatureForm&height=170&width=460&modal=true&documentID=" . $childDocument->documentID . "' class='thickbox' id='signatureForm'>"._("add signatures")."</a>";
echo "<a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getSignatureForm&height=170&width=460&modal=true&documentID=" . $childDocument->documentID . "\"200,500)' class='thickbox' id='signatureForm'>"._("add signatures")."</a>";
}
}

Expand All @@ -1003,7 +995,7 @@
echo "</td>";

if ($user->canEdit()){
echo "<td $classAdd><a href='ajax_forms.php?action=getUploadDocument&height=285&width=305&modal=true&licenseID=" . $licenseID . "&documentID=" . $childDocument->documentID . "' class='thickbox' id='editDocument'>"._("edit document")."</a><br /><a href='javascript:deleteDocument(\"" . $childDocument->documentID . "\");'>"._("remove document")."</a>";
echo "<td $classAdd><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getUploadDocument&height=285&width=305&modal=true&licenseID=" . $licenseID . "&documentID=" . $childDocument->documentID . "\",320,350)' class='thickbox' id='editDocument'>"._("edit document")."</a><br /><a href='javascript:deleteDocument(\"" . $childDocument->documentID . "\");'>"._("remove document")."</a>";
//echo "<br />" . $displayExpirationDate . "</td>";
}
echo "</tr>";
Expand Down Expand Up @@ -1047,7 +1039,6 @@


if (($user->canEdit()) && ($displayArchiveInd != "")){
// echo "<a href='ajax_forms.php?action=getUploadDocument&licenseID=" . $licenseID . "&height=280&width=310&modal=true' class='thickbox' id='uploadDocument'>"._("upload new document")."</a>";
echo "<a href='javascript:void(0)' id='uploadDocument' onclick='javascript:myDialog(\"ajax_forms.php?action=getUploadDocument&licenseID=" . $licenseID ."\",280,350)'>"._("upload new document")."</a>";
}

Expand Down Expand Up @@ -1158,7 +1149,6 @@
echo "</td>";

if ($user->canEdit()){
// echo "<td class='alt' style='text-align:center;'><a href='ajax_forms.php?action=getExpressionForm&licenseID=" . $licenseID . "&expressionID=" . $expressionIns['expressionID'] . "&height=420&width=345&modal=true' class='thickbox'><img id='Edit' src='images/edit.gif' title= '"._("Edit")."' /></a>&nbsp;&nbsp;<a href='javascript:deleteExpression(" . $expressionIns['expressionID'] . ");'><img id='Remove' class='removeIcon' src='images/cross.gif' title= '"._("Remove")."' /></a></td>";
echo "<td class='alt' style='text-align:center;'><a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getExpressionForm&licenseID=" . $licenseID . "&expressionID=" . $expressionIns['expressionID'] . "\",420,375)' class='thickbox'><img id='Edit' src='images/edit.gif' title= '"._("Edit")."' /></a>&nbsp;&nbsp;<a href='javascript:deleteExpression(" . $expressionIns['expressionID'] . ");'><img id='Remove' class='removeIcon' src='images/cross.gif' title= '"._("Remove")."' /></a></td>";
}

Expand Down Expand Up @@ -1186,7 +1176,6 @@

//link to view/edit display notes
if ($user->canEdit()){
// echo "<a href='ajax_forms.php?action=getExpressionNotesForm&height=330&width=440&modal=true&expressionID=" . $expressionIns['expressionID'] . "' class='thickbox' id='ExpressionNotes'>"._("add/view ") . lcfirst($expressionIns['noteType']) . _(" notes")."</a>";
echo "<a href='javascript:void(0)' onclick='javascript:myDialog(\"ajax_forms.php?action=getExpressionNotesForm&expressionID=" . $expressionIns['expressionID'] . "\", 330,605)' class='thickbox' id='ExpressionNotes'>"._("add/view ") . lcfirst($expressionIns['noteType']) . _(" notes")."</a>";

}
Expand All @@ -1212,7 +1201,6 @@
}

if ($user->canEdit()){
// echo "<br /><br /><a href='ajax_forms.php?action=getExpressionForm&licenseID=" . $licenseID . "&height=420&width=345&modal=true' class='thickbox' id='expression'>"._("add expression")."</a>";
echo "<br /><br /><a href='javascript:void(0)' id='expression' onclick='javascript:myDialog(\"ajax_forms.php?action=getExpressionForm&licenseID=" . $licenseID ."\",420,375)'>"._("add expression")."</a>";
}

Expand Down
5 changes: 2 additions & 3 deletions licensing/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
</div>
</a>

<!-- <a href='ajax_forms.php?action=getLicenseForm&height=265&width=260&modal=true&newLicenseID=' class='thickbox' id='newLicense'> -->
<a href='javascript:void(0)' onclick='javascript:myDialog("ajax_forms.php?action=getLicenseForm&newlicenseID=",265,280)' class='thickbox' id='newLicense'>
<div class="main-menu-link">
<img src="images/menu/icon-plus-square.png" />
Expand Down Expand Up @@ -205,7 +204,7 @@
</div>
</a>

<a href='ajax_forms.php?action=getLicenseForm&height=265&width=260&modal=true&newLicenseID=' class='thickbox' id='newLicense'>
<a href='javascript:void(0)' onclick='javascript:myDialog("ajax_forms.php?action=getLicenseForm&height=265&width=260&modal=true&newLicenseID=",300,300)' class='thickbox' id='newLicense'>
<div class="main-menu-link">
<img src="images/menu/icon-plus-square.png" />
<span><?php echo _("New License");?></span>
Expand Down Expand Up @@ -253,7 +252,7 @@
</div>
</a>

<a href='ajax_forms.php?action=getLicenseForm&height=265&width=260&modal=true&newLicenseID=' class='thickbox' id='newLicense'>
<a href='javascript:void(0)' onclick='javascript:myDialog("ajax_forms.php?action=getLicenseForm&height=265&width=260&modal=true&newLicenseID=",300,300)' class='thickbox' id='newLicense'>
<div class="main-menu-link">
<img src="images/menu/icon-plus-square.png" />
<span><?php echo _("New License");?></span>
Expand Down
2 changes: 1 addition & 1 deletion reports/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$("#reportID").change(function(){
//updateParms;
if ($("#reportID").val() != "") {
genericGetById('div_parm').innerHTML = "<br><label for=''>&nbsp;</label><img src='images/circle.gif'> " . _("Refreshing Contents...");
genericGetById('div_parm').innerHTML = "<br><label for=''>&nbsp;</label><img src='images/circle.gif'> " + _("Refreshing Contents...");
$.ajax({
type: "GET",
url: "ajax_htmldata.php",
Expand Down
8 changes: 8 additions & 0 deletions resources/ajax_forms/getNewIssueForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
<input type="hidden" name="orgModuleUrl" id="orgModuleUrl" value="<?php echo $util->getCoralUrl();?>organizations/" />
<a id="getCreateContactForm" href="#"><?php echo _("add contact");?></a>
<div id="inlineContact"></div>
<script>
$("#getCreateContactForm").on("click",function(e) {
e.preventDefault();
$(this).fadeOut(250, function() {
getInlineContactForm();
});
});
</script>
</td>
</tr>
<?php
Expand Down
6 changes: 3 additions & 3 deletions resources/ajax_htmldata/getAccountDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

if ($user->canEdit()){ ?>
<a href='ajax_forms.php?action=getAccountForm&height=314&width=403&modal=true&resourceID=<?php echo $resourceID; ?>' class='thickbox' id='newAccount'><?php echo _("add new account");?></a>
<a href='javascript:void(0)' onclick='javascript:myDialog("ajax_forms.php?action=getAccountForm&height=314&width=403&modal=true&resourceID=<?php echo $resourceID; ?>",350,450)' class='thickbox' id='newAccount'><?php echo _("add new account");?></a>
<br /><br /><br />
<?php
}
Expand All @@ -43,7 +43,7 @@
if ($user->canEdit() &&
(!array_key_exists('organizationName', $externalLogin) || (array_key_exists('organizationName', $externalLogin) && $externalLogin['organizationName'] == ''))) { ?>

<a href='ajax_forms.php?action=getAccountForm&height=314&width=403&modal=true&resourceID=<?php echo $resourceID; ?>&externalLoginID=<?php echo $externalLogin['externalLoginID']; ?>' class='thickbox'><img src='images/edit.gif' alt='<?php echo _("edit");?>' title='<?php echo _("edit account");?>'></a> <a href='javascript:void(0);' class='removeAccount' id='<?php echo $externalLogin['externalLoginID']; ?>'><img src='images/cross.gif' alt='<?php echo _("remove account");?>' title='<?php echo _("remove account");?>'></a>
<a href='javascript:void(0)' onclick='javascript:myDialog("ajax_forms.php?action=getAccountForm&height=314&width=403&modal=true&resourceID=<?php echo $resourceID; ?>&externalLoginID=<?php echo $externalLogin['externalLoginID']; ?>",350,450)' class='thickbox'><img src='images/edit.gif' alt='<?php echo _("edit");?>' title='<?php echo _("edit account");?>'></a> <a href='javascript:void(0);' class='removeAccount' id='<?php echo $externalLogin['externalLoginID']; ?>'><img src='images/cross.gif' alt='<?php echo _("remove account");?>' title='<?php echo _("remove account");?>'></a>
<?php
}else{
echo "&nbsp;";
Expand Down Expand Up @@ -118,7 +118,7 @@
}

if ($user->canEdit() && ($orgELFlag == 0)){ ?>
<a href='ajax_forms.php?action=getAccountForm&height=314&width=403&modal=true&resourceID=<?php echo $resourceID; ?>' class='thickbox' id='newAccount'><?php echo _("add new account");?></a>
<a href='javascript:void(0)' onclick='javascript:myDialog("ajax_forms.php?action=getAccountForm&height=314&width=403&modal=true&resourceID=<?php echo $resourceID; ?>",350,450)' class='thickbox' id='newAccount'><?php echo _("add new account");?></a>
<br /><br /><br />
<?php
}
Expand Down
Loading

0 comments on commit 8e6495a

Please sign in to comment.