mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 17:44:56 +00:00
place all javascript into function js()
This commit is contained in:
parent
59786c7bb0
commit
f2c239f67c
|
@ -31,19 +31,10 @@ require_once("class.Bootstrap.php");
|
|||
*/
|
||||
class SeedDMS_View_AddTransmittal extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
function show() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
function js() { /* {{{ */
|
||||
$strictformcheck = $this->params['strictformcheck'];
|
||||
|
||||
$this->htmlStartPage(getMLText("my_documents"));
|
||||
$this->globalNavigation($folder);
|
||||
$this->contentStart();
|
||||
$this->pageNavigation(getMLText("my_documents"), "my_documents");
|
||||
$this->contentHeading(getMLText("add_transmittal"));
|
||||
$this->contentContainerStart();
|
||||
header('Content-Type: application/javascript; charset=UTF-8');
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = new Array();
|
||||
|
@ -69,9 +60,29 @@ function checkForm()
|
|||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
$(document).ready(function() {
|
||||
$('body').on('submit', '#form1', function(ev){
|
||||
if(checkForm()) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
<form action="../op/op.AddTransmittal.php" name="form1" onsubmit="return checkForm();" method="post">
|
||||
function show() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$strictformcheck = $this->params['strictformcheck'];
|
||||
|
||||
$this->htmlStartPage(getMLText("my_documents"));
|
||||
$this->globalNavigation($folder);
|
||||
$this->contentStart();
|
||||
$this->pageNavigation(getMLText("my_documents"), "my_documents");
|
||||
$this->contentHeading(getMLText("add_transmittal"));
|
||||
$this->contentContainerStart();
|
||||
?>
|
||||
|
||||
<form action="../op/op.AddTransmittal.php" id="form1" name="form1" method="post">
|
||||
<?php echo createHiddenFieldWithKey('addtransmittal'); ?>
|
||||
<table class="table-condensed">
|
||||
<tr>
|
||||
|
|
|
@ -27,6 +27,50 @@ require_once("class.Bootstrap.php");
|
|||
*/
|
||||
class SeedDMS_View_CheckInDocument extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
function js() { /* {{{ */
|
||||
$strictformcheck = $this->params['strictformcheck'];
|
||||
header('Content-Type: application/javascript; charset=UTF-8');
|
||||
?>
|
||||
function checkForm()
|
||||
{
|
||||
msg = new Array();
|
||||
<?php if($dropfolderdir) { ?>
|
||||
if (document.form1.userfile.value == "" && document.form1.dropfolderfileform1.value == "") msg.push("<?php printMLText("js_no_file");?>");
|
||||
<?php } else { ?>
|
||||
if (document.form1.userfile.value == "") msg.push("<?php printMLText("js_no_file");?>");
|
||||
<?php } ?>
|
||||
<?php
|
||||
if ($strictformcheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
_timeout: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('body').on('submit', '#form1', function(ev){
|
||||
if(checkForm()) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
?>
|
||||
function __takeOverButton($name, $users) { /* {{{ */
|
||||
?>
|
||||
<span id="<?php echo $name; ?>_btn" style="cursor: pointer;" title="<?php printMLText("takeOver".$name); ?>"><i class="icon-arrow-left"></i></span>
|
||||
|
@ -66,42 +110,7 @@ $(document).ready( function() {
|
|||
$this->contentStart();
|
||||
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
||||
$this->contentHeading(getMLText("checkin_document"));
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function checkForm()
|
||||
{
|
||||
msg = new Array();
|
||||
<?php if($dropfolderdir) { ?>
|
||||
if (document.form1.userfile.value == "" && document.form1.dropfolderfileform1.value == "") msg.push("<?php printMLText("js_no_file");?>");
|
||||
<?php } else { ?>
|
||||
if (document.form1.userfile.value == "") msg.push("<?php printMLText("js_no_file");?>");
|
||||
<?php } ?>
|
||||
<?php
|
||||
if ($strictformcheck) {
|
||||
?>
|
||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if (msg != "")
|
||||
{
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
_timeout: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
if ($document->isLocked()) {
|
||||
|
||||
$lockingUser = $document->getLockingUser();
|
||||
|
@ -162,7 +171,7 @@ function checkForm()
|
|||
$this->contentContainerStart();
|
||||
?>
|
||||
|
||||
<form action="../op/op.CheckInDocument.php" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<form action="../op/op.CheckInDocument.php" method="post" id="form1" name="form1">
|
||||
<input type="hidden" name="documentid" value="<?php print $document->getID(); ?>">
|
||||
<table class="table-condensed">
|
||||
|
||||
|
@ -564,6 +573,7 @@ function checkForm()
|
|||
<input type="submit" class="btn" value="<?php printMLText("reset_checkout"); ?>">
|
||||
<?php
|
||||
}
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
} /* }}} */
|
||||
}
|
||||
|
|
|
@ -31,6 +31,62 @@ require_once("class.Bootstrap.php");
|
|||
*/
|
||||
class SeedDMS_View_ReceiptDocument extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript; charset=UTF-8');
|
||||
?>
|
||||
function checkIndForm()
|
||||
{
|
||||
msg = new Array();
|
||||
if (document.form1.reviewStatus.value == "") msg.push("<?php printMLText("js_no_receipt_status");?>");
|
||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
if (msg != "") {
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
_timeout: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
function checkGrpForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form2.reviewGroup.value == "") msg += "<?php printMLText("js_no_receipt_group");?>\n";
|
||||
if (document.form2.reviewStatus.value == "") msg += "<?php printMLText("js_no_receipt_status");?>\n";
|
||||
if (document.form2.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
_timeout: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('body').on('submit', '#form1', function(ev){
|
||||
if(checkIndForm()) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
$('body').on('submit', '#form2', function(ev){
|
||||
if(checkGrpForm()) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
|
@ -51,44 +107,6 @@ class SeedDMS_View_ReceiptDocument extends SeedDMS_Bootstrap_Style {
|
|||
$this->contentStart();
|
||||
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
||||
$this->contentHeading(getMLText("submit_receipt"));
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkIndForm()
|
||||
{
|
||||
msg = new Array();
|
||||
if (document.form1.receiptStatus.value == "") msg.push("<?php printMLText("js_no_receipt_status");?>");
|
||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
if (msg != "") {
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
_timeout: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
function checkGrpForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.receiptGroup.value == "") msg += "<?php printMLText("js_no_receipt_group");?>\n";
|
||||
if (document.form1.receiptStatus.value == "") msg += "<?php printMLText("js_no_receipt_status");?>\n";
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
$this->contentContainerStart();
|
||||
|
||||
// Display the Receipt form.
|
||||
|
@ -109,7 +127,7 @@ function checkGrpForm()
|
|||
print "</tr></tbody></table><br>";
|
||||
}
|
||||
?>
|
||||
<form method="post" action="../op/op.ReceiptDocument.php" name="form1" onsubmit="return checkIndForm();">
|
||||
<form method="post" action="../op/op.ReceiptDocument.php" id="form1" name="form1">
|
||||
<?php echo createHiddenFieldWithKey('receiptdocument'); ?>
|
||||
<table class="table-condensed">
|
||||
<tr>
|
||||
|
@ -159,7 +177,7 @@ function checkGrpForm()
|
|||
}
|
||||
|
||||
?>
|
||||
<form method="post" action="../op/op.ReceiptDocument.php" name="form1" onsubmit="return checkGrpForm();">
|
||||
<form method="post" action="../op/op.ReceiptDocument.php" id="form2" name="form2">
|
||||
<?php echo createHiddenFieldWithKey('receiptdocument'); ?>
|
||||
<table class="table-condensed">
|
||||
<tr>
|
||||
|
@ -192,6 +210,7 @@ function checkGrpForm()
|
|||
<?php
|
||||
}
|
||||
$this->contentContainerEnd();
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
} /* }}} */
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class SeedDMS_View_RemoveTransmittal extends SeedDMS_Bootstrap_Style {
|
|||
$this->contentContainerStart();
|
||||
|
||||
?>
|
||||
<form action="../op/op.UsrMgr.php" name="form1" method="post">
|
||||
<form action="../op/op.TransmittalMgr.php" name="form1" method="post">
|
||||
<input type="hidden" name="transmittalid" value="<?php print $rmtransmittal->getID();?>">
|
||||
<input type="hidden" name="action" value="removetransmittal">
|
||||
<?php echo createHiddenFieldWithKey('removetransmittal'); ?>
|
||||
|
|
|
@ -31,6 +31,62 @@ require_once("class.Bootstrap.php");
|
|||
*/
|
||||
class SeedDMS_View_ReviseDocument extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript; charset=UTF-8');
|
||||
?>
|
||||
function checkIndForm()
|
||||
{
|
||||
msg = new Array();
|
||||
if (document.form1.revisionStatus.value == "") msg.push("<?php printMLText("js_no_revision_status");?>");
|
||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
if (msg != "") {
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
_timeout: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
function checkGrpForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form2.revisionGroup.value == "") msg += "<?php printMLText("js_no_revision_group");?>\n";
|
||||
if (document.form2.revisionSatus.value == "") msg += "<?php printMLText("js_no_revision_status");?>\n";
|
||||
if (document.form2.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
_timeout: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('body').on('submit', '#form1', function(ev){
|
||||
if(checkIndForm()) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
$('body').on('submit', '#form2', function(ev){
|
||||
if(checkGrpForm()) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
|
@ -52,44 +108,6 @@ class SeedDMS_View_ReviseDocument extends SeedDMS_Bootstrap_Style {
|
|||
$this->contentStart();
|
||||
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
||||
$this->contentHeading(getMLText("submit_review"));
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function checkIndForm()
|
||||
{
|
||||
msg = new Array();
|
||||
if (document.form1.revisionStatus.value == "") msg.push("<?php printMLText("js_no_review_status");?>");
|
||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
if (msg != "") {
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
_timeout: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
function checkGrpForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form1.revisionGroup.value == "") msg += "<?php printMLText("js_no_revision_group");?>\n";
|
||||
if (document.form1.revisionStatus.value == "") msg += "<?php printMLText("js_no_revision_status");?>\n";
|
||||
if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
if (msg != "")
|
||||
{
|
||||
alert(msg);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
$this->contentContainerStart();
|
||||
|
||||
// Display the Revision form.
|
||||
|
@ -110,7 +128,7 @@ function checkGrpForm()
|
|||
print "</tr></tbody></table><br>";
|
||||
}
|
||||
?>
|
||||
<form method="post" action="../op/op.ReviseDocument.php" name="form1" onsubmit="return checkIndForm();">
|
||||
<form method="post" action="../op/op.ReviseDocument.php" id="form1" name="form1">
|
||||
<?php echo createHiddenFieldWithKey('revisedocument'); ?>
|
||||
<table class="table-condensed">
|
||||
<tr>
|
||||
|
@ -160,7 +178,7 @@ function checkGrpForm()
|
|||
}
|
||||
|
||||
?>
|
||||
<form method="post" action="../op/op.ReviseDocument.php" name="form1" onsubmit="return checkGrpForm();">
|
||||
<form method="post" action="../op/op.ReviseDocument.php" id="form2" name="form2">
|
||||
<?php echo createHiddenFieldWithKey('revisedocument'); ?>
|
||||
<table class="table-condensed">
|
||||
<tr>
|
||||
|
|
|
@ -31,83 +31,11 @@ require_once("class.Bootstrap.php");
|
|||
*/
|
||||
class SeedDMS_View_TransmittalMgr extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
/**
|
||||
* Add some javascript at the bottom of the page
|
||||
*/
|
||||
function addAdditionalJS(){ /* {{{ */
|
||||
$this->addFooterJS("
|
||||
$('body').on('click', 'button.removetransmittalitem', function(ev){
|
||||
ev.preventDefault();
|
||||
var element = $(this);
|
||||
attr_rel = $(ev.currentTarget).attr('rel');
|
||||
attr_msg = $(ev.currentTarget).attr('msg');
|
||||
attr_formtoken = $(ev.currentTarget).attr('formtoken');
|
||||
id = attr_rel;
|
||||
$.get('../op/op.Ajax.php',
|
||||
{ command: 'removetransmittalitem', id: id, formtoken: attr_formtoken },
|
||||
function(data) {
|
||||
// console.log(data);
|
||||
if(data.success) {
|
||||
$('#table-row-transmittalitem-'+id).hide('slow');
|
||||
noty({
|
||||
text: attr_msg,
|
||||
type: 'success',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 1500,
|
||||
});
|
||||
} else {
|
||||
noty({
|
||||
text: data.message,
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 3500,
|
||||
});
|
||||
}
|
||||
},
|
||||
'json'
|
||||
);
|
||||
});
|
||||
$('body').on('click', 'button.updatetransmittalitem', function(ev){
|
||||
ev.preventDefault();
|
||||
var element = $(this);
|
||||
attr_rel = $(ev.currentTarget).attr('rel');
|
||||
attr_msg = $(ev.currentTarget).attr('msg');
|
||||
attr_formtoken = $(ev.currentTarget).attr('formtoken');
|
||||
id = attr_rel;
|
||||
$.get('../op/op.Ajax.php',
|
||||
{ command: 'updatetransmittalitem', id: id, formtoken: attr_formtoken },
|
||||
function(data) {
|
||||
// console.log(data);
|
||||
if(data.success) {
|
||||
$('#update-transmittalitem-btn-'+id).hide('slow');
|
||||
noty({
|
||||
text: attr_msg,
|
||||
type: 'success',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 1500,
|
||||
});
|
||||
} else {
|
||||
noty({
|
||||
text: data.message,
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 3500,
|
||||
});
|
||||
}
|
||||
},
|
||||
'json'
|
||||
);
|
||||
$('#update-transmittalitem-btn-'+id).popover('hide');
|
||||
});
|
||||
");
|
||||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript; charset=UTF-8');
|
||||
$this->printDeleteDocumentButtonJs();
|
||||
$this->printDeleteItemButtonJs();
|
||||
$this->printUpdateItemButtonJs();
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
@ -119,14 +47,7 @@ class SeedDMS_View_TransmittalMgr extends SeedDMS_Bootstrap_Style {
|
|||
function printUpdateItemButton($item, $msg, $return=false){ /* {{{ */
|
||||
$itemid = $item->getID();
|
||||
$content = '';
|
||||
$content .= '<a id="update-transmittalitem-btn-'.$itemid.'" rel="'.$itemid.'" msg="'.htmlspecialchars($msg, ENT_QUOTES).'"><i class="icon-refresh"></i></a>';
|
||||
$this->addFooterJS("
|
||||
$('#update-transmittalitem-btn-".$itemid."').popover({
|
||||
title: '".getMLText("update_transmittalitem")."',
|
||||
placement: 'left',
|
||||
html: true,
|
||||
content: \"<div>".htmlspecialchars(getMLText("confirm_update_transmittalitem"), ENT_QUOTES)."</div><div><button class='btn btn-danger updatetransmittalitem' style='float: right; margin:10px 0px;' rel='".$itemid."' msg='".htmlspecialchars($msg, ENT_QUOTES)."' formtoken='".createFormKey('updatetransmittalitem')."' id='confirm-update-transmittalitem-btn-".$itemid."'><i class='icon-refresh'></i> ".getMLText("update_transmittalitem")."</button> <button type='button' class='btn' style='float: right; margin:10px 10px;' onclick='$("#update-transmittalitem-btn-".$itemid."").popover("hide");'>".getMLText('cancel')."</button></div>\"});
|
||||
");
|
||||
$content .= '<a class="update-transmittalitem-btn" rel="'.$itemid.'" msg="'.htmlspecialchars($msg, ENT_QUOTES).'" confirmmsg="'.htmlspecialchars(getMLText("confirm_update_transmittalitem"), ENT_QUOTES).'"><i class="icon-refresh"></i></a>';
|
||||
if($return)
|
||||
return $content;
|
||||
else
|
||||
|
@ -134,6 +55,56 @@ $('#update-transmittalitem-btn-".$itemid."').popover({
|
|||
return '';
|
||||
} /* }}} */
|
||||
|
||||
function printUpdateItemButtonJs(){ /* {{{ */
|
||||
echo "
|
||||
$(document).ready(function () {
|
||||
$('body').on('click', 'a.update-transmittalitem-btn', function(ev){
|
||||
id = $(ev.currentTarget).attr('rel');
|
||||
confirmmsg = $(ev.currentTarget).attr('confirmmsg');
|
||||
msg = $(ev.currentTarget).attr('msg');
|
||||
formtoken = '".createFormKey('updatetransmittalitem')."';
|
||||
bootbox.dialog(confirmmsg, [{
|
||||
\"label\" : \"<i class='icon-refresh'></i> ".getMLText("update_transmittalitem")."\",
|
||||
\"class\" : \"btn-danger\",
|
||||
\"callback\": function() {
|
||||
$.get('../op/op.Ajax.php',
|
||||
{ command: 'updatetransmittalitem', id: id, formtoken: formtoken },
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
$('#table-row-document-'+id).hide('slow');
|
||||
noty({
|
||||
text: msg,
|
||||
type: 'success',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 1500,
|
||||
});
|
||||
} else {
|
||||
noty({
|
||||
text: data.message,
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 3500,
|
||||
});
|
||||
}
|
||||
},
|
||||
'json'
|
||||
);
|
||||
}
|
||||
}, {
|
||||
\"label\" : \"".getMLText("cancel")."\",
|
||||
\"class\" : \"btn-cancel\",
|
||||
\"callback\": function() {
|
||||
}
|
||||
}]);
|
||||
});
|
||||
});
|
||||
";
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Print button with link for deleting a transmittal item
|
||||
*
|
||||
|
@ -147,14 +118,7 @@ $('#update-transmittalitem-btn-".$itemid."').popover({
|
|||
function printDeleteItemButton($item, $msg, $return=false){ /* {{{ */
|
||||
$itemid = $item->getID();
|
||||
$content = '';
|
||||
$content .= '<a id="delete-transmittalitem-btn-'.$itemid.'" rel="'.$itemid.'" msg="'.htmlspecialchars($msg, ENT_QUOTES).'"><i class="icon-remove"></i></a>';
|
||||
$this->addFooterJS("
|
||||
$('#delete-transmittalitem-btn-".$itemid."').popover({
|
||||
title: '".getMLText("rm_transmittalitem")."',
|
||||
placement: 'left',
|
||||
html: true,
|
||||
content: \"<div>".htmlspecialchars(getMLText("confirm_rm_transmittalitem"), ENT_QUOTES)."</div><div><button class='btn btn-danger removetransmittalitem' style='float: right; margin:10px 0px;' rel='".$itemid."' msg='".htmlspecialchars($msg, ENT_QUOTES)."' formtoken='".createFormKey('removetransmittalitem')."' id='confirm-delete-transmittalitem-btn-".$itemid."'><i class='icon-remove'></i> ".getMLText("rm_transmittalitem")."</button> <button type='button' class='btn' style='float: right; margin:10px 10px;' onclick='$("#delete-transmittalitem-btn-".$itemid."").popover("hide");'>".getMLText('cancel')."</button></div>\"});
|
||||
");
|
||||
$content .= '<a class="delete-transmittalitem-btn" rel="'.$itemid.'" msg="'.htmlspecialchars($msg, ENT_QUOTES).'" confirmmsg="'.htmlspecialchars(getMLText("confirm_rm_transmittalitem"), ENT_QUOTES).'"><i class="icon-remove"></i></a>';
|
||||
if($return)
|
||||
return $content;
|
||||
else
|
||||
|
@ -162,11 +126,61 @@ $('#delete-transmittalitem-btn-".$itemid."').popover({
|
|||
return '';
|
||||
} /* }}} */
|
||||
|
||||
function printDeleteItemButtonJs(){ /* {{{ */
|
||||
echo "
|
||||
$(document).ready(function () {
|
||||
$('body').on('click', 'a.delete-transmittalitem-btn', function(ev){
|
||||
id = $(ev.currentTarget).attr('rel');
|
||||
confirmmsg = $(ev.currentTarget).attr('confirmmsg');
|
||||
msg = $(ev.currentTarget).attr('msg');
|
||||
formtoken = '".createFormKey('removetransmittalitem')."';
|
||||
bootbox.dialog(confirmmsg, [{
|
||||
\"label\" : \"<i class='icon-remove'></i> ".getMLText("rm_transmittalitem")."\",
|
||||
\"class\" : \"btn-danger\",
|
||||
\"callback\": function() {
|
||||
$.get('../op/op.Ajax.php',
|
||||
{ command: 'removetransmittalitem', id: id, formtoken: formtoken },
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
$('#table-row-document-'+id).hide('slow');
|
||||
noty({
|
||||
text: msg,
|
||||
type: 'success',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 1500,
|
||||
});
|
||||
} else {
|
||||
noty({
|
||||
text: data.message,
|
||||
type: 'error',
|
||||
dismissQueue: true,
|
||||
layout: 'topRight',
|
||||
theme: 'defaultTheme',
|
||||
timeout: 3500,
|
||||
});
|
||||
}
|
||||
},
|
||||
'json'
|
||||
);
|
||||
}
|
||||
}, {
|
||||
\"label\" : \"".getMLText("cancel")."\",
|
||||
\"class\" : \"btn-cancel\",
|
||||
\"callback\": function() {
|
||||
}
|
||||
}]);
|
||||
});
|
||||
});
|
||||
";
|
||||
} /* }}} */
|
||||
|
||||
function showTransmittalForm($transmittal) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
?>
|
||||
<form action="../op/op.TransmittalMgr.php" method="post" enctype="multipart/form-data" name="form<?php print $transmittal ? $transmittal->getID() : '0';?>" onsubmit="return checkForm('<?php print $transmittal ? $transmittal->getID() : '0';?>');">
|
||||
<form action="../op/op.TransmittalMgr.php" method="post" enctype="multipart/form-data" name="form<?php print $transmittal ? $transmittal->getID() : '0';?>">
|
||||
<?php
|
||||
if($transmittal) {
|
||||
echo createHiddenFieldWithKey('edittransmittal');
|
||||
|
@ -221,6 +235,8 @@ $('#delete-transmittalitem-btn-".$itemid."').popover({
|
|||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
|
||||
$previewer->setConverters($previewconverters);
|
||||
|
||||
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/bootbox/bootbox.min.js"></script>'."\n", 'js');
|
||||
|
||||
$this->htmlStartPage(getMLText("my_transmittals"));
|
||||
$this->globalNavigation();
|
||||
$this->contentStart();
|
||||
|
@ -270,7 +286,6 @@ $('#delete-transmittalitem-btn-".$itemid."').popover({
|
|||
if($seltransmittal) {
|
||||
$items = $seltransmittal->getItems();
|
||||
if($items) {
|
||||
$this->addAdditionalJS();
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
|
@ -307,6 +322,7 @@ $('#delete-transmittalitem-btn-".$itemid."').popover({
|
|||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
} /* }}} */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user