BUG 10957 "Feature request - Limit input document..." SOLVED
- Feature request - Limit input document maximum size - Problema resuelto, al crear un nuevo Input Document se ha adicionado un nuevo campo "Maximum file size" y un dropdown que determina la unidad de medida en "KB y MB", esto permite definir el limite del tamañel archivo a anexar. Cuando se ejectua el caso al hacer click en "Attach", se muestra el tamañaximo que se puede adjuntar el archivo si es mayor al limite se mostrara un mensaje; asi tambien si se tiene un file asocioado a un input document al igual que lo anterior se mostrara un mensaje.
This commit is contained in:
@@ -2233,3 +2233,12 @@ var stripNonNumeric = function (str) {
|
|||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function inputDocumentVerifySize(inpDocMaxFileSize, file)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return (file.files[0].size <= inpDocMaxFileSize)? 1 : 0;
|
||||||
|
} catch (e) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3308,6 +3308,38 @@ var validateForm = function(sRequiredFields) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var arrayForm = document.getElementsByTagName("form");
|
||||||
|
var i1 = 0;
|
||||||
|
var i2 = 0;
|
||||||
|
|
||||||
|
for (i1 = 0; i1 <= arrayForm.length - 1; i1++) {
|
||||||
|
var frm = arrayForm[i1];
|
||||||
|
|
||||||
|
var arrayInput = frm.getElementsByTagName("input");
|
||||||
|
|
||||||
|
for (i2 = 0; i2 <= arrayInput.length - 1; i2++) {
|
||||||
|
var input = arrayInput[i2];
|
||||||
|
|
||||||
|
if (input.type == "file") {
|
||||||
|
if (input.value != "") {
|
||||||
|
var pmindocmaxfilesize = input.getAttribute("pmindocmaxfilesize");
|
||||||
|
|
||||||
|
if (pmindocmaxfilesize != null && pmindocmaxfilesize != "") {
|
||||||
|
var flagFilesize = inputDocumentVerifySize(parseInt(pmindocmaxfilesize), input);
|
||||||
|
|
||||||
|
if (flagFilesize == 0) {
|
||||||
|
new leimnud.module.app.alert().make({label: _("ID_SIZE_VERY_LARGE_PERMITTED")});
|
||||||
|
|
||||||
|
swSubmitValidateForm = 1;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -803,7 +803,8 @@ function stringReplace(strSearch,strReplace,str)
|
|||||||
{var expression=eval("/"+strSearch+"/g");return str.replace(expression,strReplace);}
|
{var expression=eval("/"+strSearch+"/g");return str.replace(expression,strReplace);}
|
||||||
var mb_strlen=function(str){str=str||'';var len=0;for(var i=0;i<str.length;i++){len+=str.charCodeAt(i)<0||str.charCodeAt(i)>255?2:1;}
|
var mb_strlen=function(str){str=str||'';var len=0;for(var i=0;i<str.length;i++){len+=str.charCodeAt(i)<0||str.charCodeAt(i)>255?2:1;}
|
||||||
return len;};var stripNonNumeric=function(str){str+='';var rgx=/^\d|\.|-$/;var out='';for(var i=0;i<str.length;i++){if(rgx.test(str.charAt(i))){if(!((str.charAt(i)=='.'&&out.indexOf('.')!=-1)||(str.charAt(i)=='-'&&out.length!=0))){out+=str.charAt(i);}}}
|
return len;};var stripNonNumeric=function(str){str+='';var rgx=/^\d|\.|-$/;var out='';for(var i=0;i<str.length;i++){if(rgx.test(str.charAt(i))){if(!((str.charAt(i)=='.'&&out.indexOf('.')!=-1)||(str.charAt(i)=='-'&&out.length!=0))){out+=str.charAt(i);}}}
|
||||||
return out;};
|
return out;};function inputDocumentVerifySize(inpDocMaxFileSize,file)
|
||||||
|
{try{return(file.files[0].size<=inpDocMaxFileSize)?1:0;}catch(e){return 1;}}
|
||||||
var TimeToFade=1000.0;function fade(eid,inOut){inOut=(typeof(inOut)!='undefined')?true:false;var element=document.getElementById(eid);if(element==null)
|
var TimeToFade=1000.0;function fade(eid,inOut){inOut=(typeof(inOut)!='undefined')?true:false;var element=document.getElementById(eid);if(element==null)
|
||||||
return;if(element.FadeState==null)
|
return;if(element.FadeState==null)
|
||||||
{if(element.style.opacity==null||element.style.opacity==''||element.style.opacity=='1')
|
{if(element.style.opacity==null||element.style.opacity==''||element.style.opacity=='1')
|
||||||
@@ -1240,6 +1241,7 @@ if(fielEmailInvalid.length>0){systemMessaggeInvalid+="\n \n"+G_STRINGS.ID_VALIDA
|
|||||||
alert(systemMessaggeInvalid);swSubmitValidateForm=1;return false;}
|
alert(systemMessaggeInvalid);swSubmitValidateForm=1;return false;}
|
||||||
else{var arrayForm=document.getElementsByTagName("form");var inputAux;var id="";var i1=0;var i2=0;for(i1=0;i1<=arrayForm.length-1;i1++){var frm=arrayForm[i1];for(i2=0;i2<=frm.elements.length-1;i2++){var elem=frm.elements[i2];if(elem.type=="checkbox"&&elem.disabled&&elem.checked){id=elem.id+"_";if(!document.getElementById(id)){inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=elem.name;inputAux.value=elem.value;frm.appendChild(inputAux);}}}
|
else{var arrayForm=document.getElementsByTagName("form");var inputAux;var id="";var i1=0;var i2=0;for(i1=0;i1<=arrayForm.length-1;i1++){var frm=arrayForm[i1];for(i2=0;i2<=frm.elements.length-1;i2++){var elem=frm.elements[i2];if(elem.type=="checkbox"&&elem.disabled&&elem.checked){id=elem.id+"_";if(!document.getElementById(id)){inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=elem.name;inputAux.value=elem.value;frm.appendChild(inputAux);}}}
|
||||||
var arrayLink=frm.getElementsByTagName("a");for(i2=0;i2<=arrayLink.length-1;i2++){var link=arrayLink[i2];if(typeof link.id!="undefined"&&link.id!=""&&link.id!="form[DYN_BACKWARD]"&&link.id!="form[DYN_FORWARD]"){var strHtml=link.parentNode.innerHTML;strHtml=stringReplace("\\x0A","",strHtml);strHtml=stringReplace("\\x0D","",strHtml);strHtml=stringReplace("\\x09","",strHtml);if(/^.*pm:field.*$/.test(strHtml)){id=link.id+"_";if(!document.getElementById(id)){var strAux=link.id.replace("form[","");strAux=strAux.substring(0,strAux.length-1);inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=link.id;inputAux.value=link.href;frm.appendChild(inputAux);inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id+"label";inputAux.name="form["+strAux+"_label]";inputAux.value=link.innerHTML;frm.appendChild(inputAux);}}}}}
|
var arrayLink=frm.getElementsByTagName("a");for(i2=0;i2<=arrayLink.length-1;i2++){var link=arrayLink[i2];if(typeof link.id!="undefined"&&link.id!=""&&link.id!="form[DYN_BACKWARD]"&&link.id!="form[DYN_FORWARD]"){var strHtml=link.parentNode.innerHTML;strHtml=stringReplace("\\x0A","",strHtml);strHtml=stringReplace("\\x0D","",strHtml);strHtml=stringReplace("\\x09","",strHtml);if(/^.*pm:field.*$/.test(strHtml)){id=link.id+"_";if(!document.getElementById(id)){var strAux=link.id.replace("form[","");strAux=strAux.substring(0,strAux.length-1);inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=link.id;inputAux.value=link.href;frm.appendChild(inputAux);inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id+"label";inputAux.name="form["+strAux+"_label]";inputAux.value=link.innerHTML;frm.appendChild(inputAux);}}}}}
|
||||||
|
var arrayForm=document.getElementsByTagName("form");var i1=0;var i2=0;for(i1=0;i1<=arrayForm.length-1;i1++){var frm=arrayForm[i1];var arrayInput=frm.getElementsByTagName("input");for(i2=0;i2<=arrayInput.length-1;i2++){var input=arrayInput[i2];if(input.type=="file"){if(input.value!=""){var pmindocmaxfilesize=input.getAttribute("pmindocmaxfilesize");if(pmindocmaxfilesize!=null&&pmindocmaxfilesize!=""){var flagFilesize=inputDocumentVerifySize(parseInt(pmindocmaxfilesize),input);if(flagFilesize==0){new leimnud.module.app.alert().make({label:_("ID_SIZE_VERY_LARGE_PERMITTED")});swSubmitValidateForm=1;return false;}}}}}}
|
||||||
return true;}}else{return false;}};var getObject=function(sObject){var i;var oAux=null;var iLength=__aObjects__.length;for(i=0;i<iLength;i++){oAux=__aObjects__[i].getElementByName(sObject);if(oAux){return oAux;}}
|
return true;}}else{return false;}};var getObject=function(sObject){var i;var oAux=null;var iLength=__aObjects__.length;for(i=0;i<iLength;i++){oAux=__aObjects__[i].getElementByName(sObject);if(oAux){return oAux;}}
|
||||||
return oAux;};var saveAndRefreshForm=function(oObject){if(oObject){oObject.form.action+='&_REFRESH_=1';oObject.form.submit();}
|
return oAux;};var saveAndRefreshForm=function(oObject){if(oObject){oObject.form.action+='&_REFRESH_=1';oObject.form.submit();}
|
||||||
else{var oAux=window.document.getElementsByTagName('form');if(oAux.length>0){oAux[0].action+='&_REFRESH_=1';oAux[0].submit();}}};var sessionPersits=function(){var rpc=new leimnud.module.rpc.xmlhttp({url:'../services/sessionPersists',args:'dynaformRestoreValues='+(typeof(__dynaformSVal__)!='undefined'?__dynaformSVal__:''),async:false});rpc.make();var response=rpc.xmlhttp.responseText.parseJSON();return response.status;};var showPromptLogin=function(lastAction){lastActionPerformed=lastAction;promptPanel=new leimnud.module.panel();promptPanel.options={statusBarButtons:[{value:_('LOGIN')}],position:{center:true},size:{w:300,h:130},control:{close:false,resize:false},fx:{modal:true}};promptPanel.setStyle={content:{padding:10,paddingBottom:2,textAlign:'left',paddingLeft:50,backgroundRepeat:'no-repeat',backgroundPosition:'10 50%',backgroundColor:'transparent',borderWidth:0}};promptPanel.make();promptPanel.addContent(_('ID_DYNAFORM_EDITOR_LOGIN_AGAIN'));promptPanel.addContent('<br />');var thePassword=$dce('input');thePassword.type='password';thePassword.id='thePassword';leimnud.dom.setStyle(thePassword,{font:'normal 8pt Tahoma,MiscFixed',color:'#000',width:'100%',marginTop:3,backgroundColor:'white',border:'1px solid #919B9C'});promptPanel.addContent(thePassword);thePassword.focus();thePassword.onkeyup=function(evt)
|
else{var oAux=window.document.getElementsByTagName('form');if(oAux.length>0){oAux[0].action+='&_REFRESH_=1';oAux[0].submit();}}};var sessionPersits=function(){var rpc=new leimnud.module.rpc.xmlhttp({url:'../services/sessionPersists',args:'dynaformRestoreValues='+(typeof(__dynaformSVal__)!='undefined'?__dynaformSVal__:''),async:false});rpc.make();var response=rpc.xmlhttp.responseText.parseJSON();return response.status;};var showPromptLogin=function(lastAction){lastActionPerformed=lastAction;promptPanel=new leimnud.module.panel();promptPanel.options={statusBarButtons:[{value:_('LOGIN')}],position:{center:true},size:{w:300,h:130},control:{close:false,resize:false},fx:{modal:true}};promptPanel.setStyle={content:{padding:10,paddingBottom:2,textAlign:'left',paddingLeft:50,backgroundRepeat:'no-repeat',backgroundPosition:'10 50%',backgroundColor:'transparent',borderWidth:0}};promptPanel.make();promptPanel.addContent(_('ID_DYNAFORM_EDITOR_LOGIN_AGAIN'));promptPanel.addContent('<br />');var thePassword=$dce('input');thePassword.type='password';thePassword.id='thePassword';leimnud.dom.setStyle(thePassword,{font:'normal 8pt Tahoma,MiscFixed',color:'#000',width:'100%',marginTop:3,backgroundColor:'white',border:'1px solid #919B9C'});promptPanel.addContent(thePassword);thePassword.focus();thePassword.onkeyup=function(evt)
|
||||||
|
|||||||
@@ -3007,17 +3007,35 @@ class XmlForm_Field_File extends XmlForm_Field
|
|||||||
$styleDisplay = "display: none;";
|
$styleDisplay = "display: none;";
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = $html1 . "<input type=\"file\" ".$pmtype." id=\"form" . $rowId . "[" . $this->name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2;
|
$arrayInputDocumentData = array();
|
||||||
|
$inpDocMaxFilesize = "";
|
||||||
|
|
||||||
if (isset($this->input) && $this->input != null) {
|
if (isset($this->input) && $this->input != null) {
|
||||||
require_once ("classes/model/InputDocument.php");
|
require_once ("classes" . PATH_SEP . "model" . PATH_SEP . "InputDocument.php");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$indoc = new InputDocument();
|
$inputDocument = new InputDocument();
|
||||||
$aDoc = $indoc->load( $this->input );
|
$arrayInputDocumentData = $inputDocument->load($this->input);
|
||||||
$aDoc["INP_DOC_TITLE"] = (isset( $aDoc["INP_DOC_TITLE"] )) ? $aDoc["INP_DOC_TITLE"] : null;
|
|
||||||
$html = $html . "<label><img src=\"/images/inputdocument.gif\" width=\"22px\" width=\"22px\" alt=\"\" /><font size=\"1\">(" . trim( $aDoc["INP_DOC_TITLE"] ) . ")</font></label>";
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
//Then the input document doesn"t exits, id referencial broken
|
//Then the input document doesn"t exits, id referencial broken
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($arrayInputDocumentData) > 0) {
|
||||||
|
$inpDocMaxFilesize = $arrayInputDocumentData["INP_DOC_MAX_FILESIZE"] * (($arrayInputDocumentData["INP_DOC_MAX_FILESIZE_UNIT"] == "MB")? 1024 *1024 : 1024); //Bytes
|
||||||
|
}
|
||||||
|
|
||||||
|
$pmInputDocument = "pmindocmaxfilesize=\"" . $inpDocMaxFilesize . "\""; //Bytes
|
||||||
|
|
||||||
|
$html = $html1 . "<input type=\"file\" " . $pmtype . " " . $pmInputDocument . " id=\"form" . $rowId . "[" . $this->name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2;
|
||||||
|
|
||||||
|
if (isset($this->input) && $this->input != null) {
|
||||||
|
if (count($arrayInputDocumentData) > 0) {
|
||||||
|
$maxUploadFilesizeLabel = ($arrayInputDocumentData["INP_DOC_MAX_FILESIZE"] . "" != "0" && $arrayInputDocumentData["INP_DOC_MAX_FILESIZE"] != "")? "Max upload file size [" . $arrayInputDocumentData["INP_DOC_MAX_FILESIZE"] . " " . $arrayInputDocumentData["INP_DOC_MAX_FILESIZE_UNIT"] . "]" : "";
|
||||||
|
|
||||||
|
$arrayInputDocumentData["INP_DOC_TITLE"] = (isset($arrayInputDocumentData["INP_DOC_TITLE"]))? $arrayInputDocumentData["INP_DOC_TITLE"] : null;
|
||||||
|
$html = $html . "<br /><label><img src=\"/images/inputdocument.gif\" width=\"22px\" width=\"22px\" alt=\"\" /><font size=\"1\">(" . trim($arrayInputDocumentData["INP_DOC_TITLE"]) . ") " . $maxUploadFilesizeLabel . "</font></label>";
|
||||||
|
} else {
|
||||||
$html = $html . " <font color=\"red\"><img src=\"/images/alert_icon.gif\" width=\"16px\" width=\"16px\" alt=\"\" /><font size=\"1\">(" . G::loadTranslation("ID_INPUT_DOC_DOESNT_EXIST") . ")</font></font>";
|
$html = $html . " <font color=\"red\"><img src=\"/images/alert_icon.gif\" width=\"16px\" width=\"16px\" alt=\"\" /><font size=\"1\">(" . G::loadTranslation("ID_INPUT_DOC_DOESNT_EXIST") . ")</font></font>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3517,9 +3517,10 @@ class Cases
|
|||||||
* @param string $file File ($_FILES["form"]["name"]["APP_DOC_FILENAME"] or path to file)
|
* @param string $file File ($_FILES["form"]["name"]["APP_DOC_FILENAME"] or path to file)
|
||||||
* @param int $fileError File error ($_FILES["form"]["error"]["APP_DOC_FILENAME"] or 0)
|
* @param int $fileError File error ($_FILES["form"]["error"]["APP_DOC_FILENAME"] or 0)
|
||||||
* @param string $fileTmpName File temporal name ($_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"] or null)
|
* @param string $fileTmpName File temporal name ($_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"] or null)
|
||||||
|
* @param string $fileSize File size ($_FILES["form"]["size"]["APP_DOC_FILENAME"] or 0)
|
||||||
* @return string Return application document ID
|
* @return string Return application document ID
|
||||||
*/
|
*/
|
||||||
public function addInputDocument($inputDocumentUid, $appDocUid, $docVersion, $appDocType, $appDocComment, $inputDocumentAction, $applicationUid, $delIndex, $taskUid, $userUid, $option, $file, $fileError = 0, $fileTmpName = null)
|
public function addInputDocument($inputDocumentUid, $appDocUid, $docVersion, $appDocType, $appDocComment, $inputDocumentAction, $applicationUid, $delIndex, $taskUid, $userUid, $option, $file, $fileError = 0, $fileTmpName = null, $fileSize = 0)
|
||||||
{
|
{
|
||||||
$appDocFileName = null;
|
$appDocFileName = null;
|
||||||
$sw = 0;
|
$sw = 0;
|
||||||
@@ -3549,6 +3550,16 @@ class Cases
|
|||||||
$inputDocument = new InputDocument();
|
$inputDocument = new InputDocument();
|
||||||
$arrayInputDocumentData = $inputDocument->load($inputDocumentUid);
|
$arrayInputDocumentData = $inputDocument->load($inputDocumentUid);
|
||||||
|
|
||||||
|
//---
|
||||||
|
$inpDocMaxFilesize = $arrayInputDocumentData["INP_DOC_MAX_FILESIZE"];
|
||||||
|
$inpDocMaxFilesizeUnit = $arrayInputDocumentData["INP_DOC_MAX_FILESIZE_UNIT"];
|
||||||
|
|
||||||
|
$inpDocMaxFilesize = $inpDocMaxFilesize * (($inpDocMaxFilesizeUnit == "MB")? 1024 *1024 : 1024); //Bytes
|
||||||
|
|
||||||
|
if ($fileSize > $inpDocMaxFilesize) {
|
||||||
|
throw new Exception(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"));
|
||||||
|
}
|
||||||
|
|
||||||
//Get the Custom Folder ID (create if necessary)
|
//Get the Custom Folder ID (create if necessary)
|
||||||
$appFolder = new AppFolder();
|
$appFolder = new AppFolder();
|
||||||
$folderId = $appFolder->createFromPath($arrayInputDocumentData["INP_DOC_DESTINATION_PATH"], $applicationUid);
|
$folderId = $appFolder->createFromPath($arrayInputDocumentData["INP_DOC_DESTINATION_PATH"], $applicationUid);
|
||||||
|
|||||||
@@ -83,6 +83,10 @@ class InputDocumentMapBuilder
|
|||||||
|
|
||||||
$tMap->addColumn('INP_DOC_TYPE_FILE', 'InpDocTypeFile', 'string', CreoleTypes::VARCHAR, false, 200);
|
$tMap->addColumn('INP_DOC_TYPE_FILE', 'InpDocTypeFile', 'string', CreoleTypes::VARCHAR, false, 200);
|
||||||
|
|
||||||
|
$tMap->addColumn('INP_DOC_MAX_FILESIZE', 'InpDocMaxFilesize', 'int', CreoleTypes::INTEGER, true, null);
|
||||||
|
|
||||||
|
$tMap->addColumn('INP_DOC_MAX_FILESIZE_UNIT', 'InpDocMaxFilesizeUnit', 'string', CreoleTypes::VARCHAR, true, 2);
|
||||||
|
|
||||||
$tMap->addValidator('INP_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Input Document UID can be no larger than 32 in size');
|
$tMap->addValidator('INP_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Input Document UID can be no larger than 32 in size');
|
||||||
|
|
||||||
$tMap->addValidator('INP_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Input Document UID is required.');
|
$tMap->addValidator('INP_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Input Document UID is required.');
|
||||||
|
|||||||
@@ -81,6 +81,18 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $inp_doc_type_file = '*.*';
|
protected $inp_doc_type_file = '*.*';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the inp_doc_max_filesize field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $inp_doc_max_filesize = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the inp_doc_max_filesize_unit field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $inp_doc_max_filesize_unit = 'KB';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag to prevent endless save loop, if this object is referenced
|
* Flag to prevent endless save loop, if this object is referenced
|
||||||
* by another object which falls in this transaction.
|
* by another object which falls in this transaction.
|
||||||
@@ -194,6 +206,28 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
return $this->inp_doc_type_file;
|
return $this->inp_doc_type_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [inp_doc_max_filesize] column value.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getInpDocMaxFilesize()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->inp_doc_max_filesize;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [inp_doc_max_filesize_unit] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getInpDocMaxFilesizeUnit()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->inp_doc_max_filesize_unit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [inp_doc_uid] column.
|
* Set the value of [inp_doc_uid] column.
|
||||||
*
|
*
|
||||||
@@ -392,6 +426,50 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
|
|
||||||
} // setInpDocTypeFile()
|
} // setInpDocTypeFile()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [inp_doc_max_filesize] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setInpDocMaxFilesize($v)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Since the native PHP type for this column is integer,
|
||||||
|
// we will cast the input value to an int (if it is not).
|
||||||
|
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||||
|
$v = (int) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->inp_doc_max_filesize !== $v || $v === 0) {
|
||||||
|
$this->inp_doc_max_filesize = $v;
|
||||||
|
$this->modifiedColumns[] = InputDocumentPeer::INP_DOC_MAX_FILESIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setInpDocMaxFilesize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [inp_doc_max_filesize_unit] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setInpDocMaxFilesizeUnit($v)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Since the native PHP type for this column is string,
|
||||||
|
// we will cast the input to a string (if it is not).
|
||||||
|
if ($v !== null && !is_string($v)) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->inp_doc_max_filesize_unit !== $v || $v === 'KB') {
|
||||||
|
$this->inp_doc_max_filesize_unit = $v;
|
||||||
|
$this->modifiedColumns[] = InputDocumentPeer::INP_DOC_MAX_FILESIZE_UNIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setInpDocMaxFilesizeUnit()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hydrates (populates) the object variables with values from the database resultset.
|
* Hydrates (populates) the object variables with values from the database resultset.
|
||||||
*
|
*
|
||||||
@@ -427,12 +505,16 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$this->inp_doc_type_file = $rs->getString($startcol + 8);
|
$this->inp_doc_type_file = $rs->getString($startcol + 8);
|
||||||
|
|
||||||
|
$this->inp_doc_max_filesize = $rs->getInt($startcol + 9);
|
||||||
|
|
||||||
|
$this->inp_doc_max_filesize_unit = $rs->getString($startcol + 10);
|
||||||
|
|
||||||
$this->resetModified();
|
$this->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
|
||||||
// FIXME - using NUM_COLUMNS may be clearer.
|
// FIXME - using NUM_COLUMNS may be clearer.
|
||||||
return $startcol + 9; // 9 = InputDocumentPeer::NUM_COLUMNS - InputDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
|
return $startcol + 11; // 11 = InputDocumentPeer::NUM_COLUMNS - InputDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating InputDocument object", $e);
|
throw new PropelException("Error populating InputDocument object", $e);
|
||||||
@@ -663,6 +745,12 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
case 8:
|
case 8:
|
||||||
return $this->getInpDocTypeFile();
|
return $this->getInpDocTypeFile();
|
||||||
break;
|
break;
|
||||||
|
case 9:
|
||||||
|
return $this->getInpDocMaxFilesize();
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
return $this->getInpDocMaxFilesizeUnit();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
break;
|
break;
|
||||||
@@ -692,6 +780,8 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
$keys[6] => $this->getInpDocDestinationPath(),
|
$keys[6] => $this->getInpDocDestinationPath(),
|
||||||
$keys[7] => $this->getInpDocTags(),
|
$keys[7] => $this->getInpDocTags(),
|
||||||
$keys[8] => $this->getInpDocTypeFile(),
|
$keys[8] => $this->getInpDocTypeFile(),
|
||||||
|
$keys[9] => $this->getInpDocMaxFilesize(),
|
||||||
|
$keys[10] => $this->getInpDocMaxFilesizeUnit(),
|
||||||
);
|
);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -750,6 +840,12 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
case 8:
|
case 8:
|
||||||
$this->setInpDocTypeFile($value);
|
$this->setInpDocTypeFile($value);
|
||||||
break;
|
break;
|
||||||
|
case 9:
|
||||||
|
$this->setInpDocMaxFilesize($value);
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
$this->setInpDocMaxFilesizeUnit($value);
|
||||||
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -809,6 +905,14 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
$this->setInpDocTypeFile($arr[$keys[8]]);
|
$this->setInpDocTypeFile($arr[$keys[8]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[9], $arr)) {
|
||||||
|
$this->setInpDocMaxFilesize($arr[$keys[9]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[10], $arr)) {
|
||||||
|
$this->setInpDocMaxFilesizeUnit($arr[$keys[10]]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -856,6 +960,14 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
$criteria->add(InputDocumentPeer::INP_DOC_TYPE_FILE, $this->inp_doc_type_file);
|
$criteria->add(InputDocumentPeer::INP_DOC_TYPE_FILE, $this->inp_doc_type_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(InputDocumentPeer::INP_DOC_MAX_FILESIZE)) {
|
||||||
|
$criteria->add(InputDocumentPeer::INP_DOC_MAX_FILESIZE, $this->inp_doc_max_filesize);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(InputDocumentPeer::INP_DOC_MAX_FILESIZE_UNIT)) {
|
||||||
|
$criteria->add(InputDocumentPeer::INP_DOC_MAX_FILESIZE_UNIT, $this->inp_doc_max_filesize_unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
@@ -926,6 +1038,10 @@ abstract class BaseInputDocument extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$copyObj->setInpDocTypeFile($this->inp_doc_type_file);
|
$copyObj->setInpDocTypeFile($this->inp_doc_type_file);
|
||||||
|
|
||||||
|
$copyObj->setInpDocMaxFilesize($this->inp_doc_max_filesize);
|
||||||
|
|
||||||
|
$copyObj->setInpDocMaxFilesizeUnit($this->inp_doc_max_filesize_unit);
|
||||||
|
|
||||||
|
|
||||||
$copyObj->setNew(true);
|
$copyObj->setNew(true);
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ abstract class BaseInputDocumentPeer
|
|||||||
const CLASS_DEFAULT = 'classes.model.InputDocument';
|
const CLASS_DEFAULT = 'classes.model.InputDocument';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 9;
|
const NUM_COLUMNS = 11;
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
/** The number of lazy-loaded columns. */
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
@@ -58,6 +58,12 @@ abstract class BaseInputDocumentPeer
|
|||||||
/** the column name for the INP_DOC_TYPE_FILE field */
|
/** the column name for the INP_DOC_TYPE_FILE field */
|
||||||
const INP_DOC_TYPE_FILE = 'INPUT_DOCUMENT.INP_DOC_TYPE_FILE';
|
const INP_DOC_TYPE_FILE = 'INPUT_DOCUMENT.INP_DOC_TYPE_FILE';
|
||||||
|
|
||||||
|
/** the column name for the INP_DOC_MAX_FILESIZE field */
|
||||||
|
const INP_DOC_MAX_FILESIZE = 'INPUT_DOCUMENT.INP_DOC_MAX_FILESIZE';
|
||||||
|
|
||||||
|
/** the column name for the INP_DOC_MAX_FILESIZE_UNIT field */
|
||||||
|
const INP_DOC_MAX_FILESIZE_UNIT = 'INPUT_DOCUMENT.INP_DOC_MAX_FILESIZE_UNIT';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
|
|
||||||
@@ -69,10 +75,10 @@ abstract class BaseInputDocumentPeer
|
|||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
*/
|
*/
|
||||||
private static $fieldNames = array (
|
private static $fieldNames = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('InpDocUid', 'ProUid', 'InpDocFormNeeded', 'InpDocOriginal', 'InpDocPublished', 'InpDocVersioning', 'InpDocDestinationPath', 'InpDocTags', 'InpDocTypeFile', ),
|
BasePeer::TYPE_PHPNAME => array ('InpDocUid', 'ProUid', 'InpDocFormNeeded', 'InpDocOriginal', 'InpDocPublished', 'InpDocVersioning', 'InpDocDestinationPath', 'InpDocTags', 'InpDocTypeFile', 'InpDocMaxFilesize', 'InpDocMaxFilesizeUnit', ),
|
||||||
BasePeer::TYPE_COLNAME => array (InputDocumentPeer::INP_DOC_UID, InputDocumentPeer::PRO_UID, InputDocumentPeer::INP_DOC_FORM_NEEDED, InputDocumentPeer::INP_DOC_ORIGINAL, InputDocumentPeer::INP_DOC_PUBLISHED, InputDocumentPeer::INP_DOC_VERSIONING, InputDocumentPeer::INP_DOC_DESTINATION_PATH, InputDocumentPeer::INP_DOC_TAGS, InputDocumentPeer::INP_DOC_TYPE_FILE, ),
|
BasePeer::TYPE_COLNAME => array (InputDocumentPeer::INP_DOC_UID, InputDocumentPeer::PRO_UID, InputDocumentPeer::INP_DOC_FORM_NEEDED, InputDocumentPeer::INP_DOC_ORIGINAL, InputDocumentPeer::INP_DOC_PUBLISHED, InputDocumentPeer::INP_DOC_VERSIONING, InputDocumentPeer::INP_DOC_DESTINATION_PATH, InputDocumentPeer::INP_DOC_TAGS, InputDocumentPeer::INP_DOC_TYPE_FILE, InputDocumentPeer::INP_DOC_MAX_FILESIZE, InputDocumentPeer::INP_DOC_MAX_FILESIZE_UNIT, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('INP_DOC_UID', 'PRO_UID', 'INP_DOC_FORM_NEEDED', 'INP_DOC_ORIGINAL', 'INP_DOC_PUBLISHED', 'INP_DOC_VERSIONING', 'INP_DOC_DESTINATION_PATH', 'INP_DOC_TAGS', 'INP_DOC_TYPE_FILE', ),
|
BasePeer::TYPE_FIELDNAME => array ('INP_DOC_UID', 'PRO_UID', 'INP_DOC_FORM_NEEDED', 'INP_DOC_ORIGINAL', 'INP_DOC_PUBLISHED', 'INP_DOC_VERSIONING', 'INP_DOC_DESTINATION_PATH', 'INP_DOC_TAGS', 'INP_DOC_TYPE_FILE', 'INP_DOC_MAX_FILESIZE', 'INP_DOC_MAX_FILESIZE_UNIT', ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,10 +88,10 @@ abstract class BaseInputDocumentPeer
|
|||||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
*/
|
*/
|
||||||
private static $fieldKeys = array (
|
private static $fieldKeys = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('InpDocUid' => 0, 'ProUid' => 1, 'InpDocFormNeeded' => 2, 'InpDocOriginal' => 3, 'InpDocPublished' => 4, 'InpDocVersioning' => 5, 'InpDocDestinationPath' => 6, 'InpDocTags' => 7, 'InpDocTypeFile' => 8, ),
|
BasePeer::TYPE_PHPNAME => array ('InpDocUid' => 0, 'ProUid' => 1, 'InpDocFormNeeded' => 2, 'InpDocOriginal' => 3, 'InpDocPublished' => 4, 'InpDocVersioning' => 5, 'InpDocDestinationPath' => 6, 'InpDocTags' => 7, 'InpDocTypeFile' => 8, 'InpDocMaxFilesize' => 9, 'InpDocMaxFilesizeUnit' => 10, ),
|
||||||
BasePeer::TYPE_COLNAME => array (InputDocumentPeer::INP_DOC_UID => 0, InputDocumentPeer::PRO_UID => 1, InputDocumentPeer::INP_DOC_FORM_NEEDED => 2, InputDocumentPeer::INP_DOC_ORIGINAL => 3, InputDocumentPeer::INP_DOC_PUBLISHED => 4, InputDocumentPeer::INP_DOC_VERSIONING => 5, InputDocumentPeer::INP_DOC_DESTINATION_PATH => 6, InputDocumentPeer::INP_DOC_TAGS => 7, InputDocumentPeer::INP_DOC_TYPE_FILE => 8, ),
|
BasePeer::TYPE_COLNAME => array (InputDocumentPeer::INP_DOC_UID => 0, InputDocumentPeer::PRO_UID => 1, InputDocumentPeer::INP_DOC_FORM_NEEDED => 2, InputDocumentPeer::INP_DOC_ORIGINAL => 3, InputDocumentPeer::INP_DOC_PUBLISHED => 4, InputDocumentPeer::INP_DOC_VERSIONING => 5, InputDocumentPeer::INP_DOC_DESTINATION_PATH => 6, InputDocumentPeer::INP_DOC_TAGS => 7, InputDocumentPeer::INP_DOC_TYPE_FILE => 8, InputDocumentPeer::INP_DOC_MAX_FILESIZE => 9, InputDocumentPeer::INP_DOC_MAX_FILESIZE_UNIT => 10, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('INP_DOC_UID' => 0, 'PRO_UID' => 1, 'INP_DOC_FORM_NEEDED' => 2, 'INP_DOC_ORIGINAL' => 3, 'INP_DOC_PUBLISHED' => 4, 'INP_DOC_VERSIONING' => 5, 'INP_DOC_DESTINATION_PATH' => 6, 'INP_DOC_TAGS' => 7, 'INP_DOC_TYPE_FILE' => 8, ),
|
BasePeer::TYPE_FIELDNAME => array ('INP_DOC_UID' => 0, 'PRO_UID' => 1, 'INP_DOC_FORM_NEEDED' => 2, 'INP_DOC_ORIGINAL' => 3, 'INP_DOC_PUBLISHED' => 4, 'INP_DOC_VERSIONING' => 5, 'INP_DOC_DESTINATION_PATH' => 6, 'INP_DOC_TAGS' => 7, 'INP_DOC_TYPE_FILE' => 8, 'INP_DOC_MAX_FILESIZE' => 9, 'INP_DOC_MAX_FILESIZE_UNIT' => 10, ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -204,6 +210,10 @@ abstract class BaseInputDocumentPeer
|
|||||||
|
|
||||||
$criteria->addSelectColumn(InputDocumentPeer::INP_DOC_TYPE_FILE);
|
$criteria->addSelectColumn(InputDocumentPeer::INP_DOC_TYPE_FILE);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(InputDocumentPeer::INP_DOC_MAX_FILESIZE);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(InputDocumentPeer::INP_DOC_MAX_FILESIZE_UNIT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(INPUT_DOCUMENT.INP_DOC_UID)';
|
const COUNT = 'COUNT(INPUT_DOCUMENT.INP_DOC_UID)';
|
||||||
|
|||||||
@@ -581,6 +581,8 @@
|
|||||||
<column name="INP_DOC_DESTINATION_PATH" type="LONGVARCHAR" required="false"/>
|
<column name="INP_DOC_DESTINATION_PATH" type="LONGVARCHAR" required="false"/>
|
||||||
<column name="INP_DOC_TAGS" type="LONGVARCHAR" required="false"/>
|
<column name="INP_DOC_TAGS" type="LONGVARCHAR" required="false"/>
|
||||||
<column name="INP_DOC_TYPE_FILE" type="VARCHAR" size="200" required="false" default="*.*"/>
|
<column name="INP_DOC_TYPE_FILE" type="VARCHAR" size="200" required="false" default="*.*"/>
|
||||||
|
<column name="INP_DOC_MAX_FILESIZE" type="INTEGER" required="true" default="0"/>
|
||||||
|
<column name="INP_DOC_MAX_FILESIZE_UNIT" type="VARCHAR" size="2" required="true" default="KB"/>
|
||||||
<validator column="INP_DOC_UID">
|
<validator column="INP_DOC_UID">
|
||||||
<rule name="maxLength" value="32" message="Input Document UID can be no larger than ${value} in size"/>
|
<rule name="maxLength" value="32" message="Input Document UID can be no larger than ${value} in size"/>
|
||||||
<rule name="required" message="Input Document UID is required."/>
|
<rule name="required" message="Input Document UID is required."/>
|
||||||
|
|||||||
@@ -593,6 +593,8 @@ CREATE TABLE [INPUT_DOCUMENT]
|
|||||||
[INP_DOC_VERSIONING] TINYINT default 0 NOT NULL,
|
[INP_DOC_VERSIONING] TINYINT default 0 NOT NULL,
|
||||||
[INP_DOC_DESTINATION_PATH] NVARCHAR(MAX) NULL,
|
[INP_DOC_DESTINATION_PATH] NVARCHAR(MAX) NULL,
|
||||||
[INP_DOC_TAGS] NVARCHAR(MAX) NULL,
|
[INP_DOC_TAGS] NVARCHAR(MAX) NULL,
|
||||||
|
[INP_DOC_MAX_FILESIZE] INT default 0 NOT NULL,
|
||||||
|
[INP_DOC_MAX_FILESIZE_UNIT] VARCHAR(2) default 'KB' NOT NULL,
|
||||||
CONSTRAINT INPUT_DOCUMENT_PK PRIMARY KEY ([INP_DOC_UID])
|
CONSTRAINT INPUT_DOCUMENT_PK PRIMARY KEY ([INP_DOC_UID])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -268,6 +268,8 @@ CREATE TABLE `INPUT_DOCUMENT`
|
|||||||
`INP_DOC_DESTINATION_PATH` MEDIUMTEXT,
|
`INP_DOC_DESTINATION_PATH` MEDIUMTEXT,
|
||||||
`INP_DOC_TAGS` MEDIUMTEXT,
|
`INP_DOC_TAGS` MEDIUMTEXT,
|
||||||
`INP_DOC_TYPE_FILE` VARCHAR(200) default '*.*',
|
`INP_DOC_TYPE_FILE` VARCHAR(200) default '*.*',
|
||||||
|
`INP_DOC_MAX_FILESIZE` INTEGER default 0 NOT NULL,
|
||||||
|
`INP_DOC_MAX_FILESIZE_UNIT` VARCHAR(2) default 'KB' NOT NULL,
|
||||||
PRIMARY KEY (`INP_DOC_UID`)
|
PRIMARY KEY (`INP_DOC_UID`)
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Documentation required';
|
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Documentation required';
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -333,6 +333,8 @@ CREATE TABLE "INPUT_DOCUMENT"
|
|||||||
"INP_DOC_VERSIONING" NUMBER(3,0) default 0 NOT NULL,
|
"INP_DOC_VERSIONING" NUMBER(3,0) default 0 NOT NULL,
|
||||||
"INP_DOC_DESTINATION_PATH" VARCHAR2(2000),
|
"INP_DOC_DESTINATION_PATH" VARCHAR2(2000),
|
||||||
"INP_DOC_TAGS" VARCHAR2(2000)
|
"INP_DOC_TAGS" VARCHAR2(2000)
|
||||||
|
"INP_DOC_MAX_FILESIZE" NUMBER default 0 NOT NULL,
|
||||||
|
"INP_DOC_MAX_FILESIZE_UNIT" VARCHAR2(2) default 'KB' NOT NULL,
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE "INPUT_DOCUMENT"
|
ALTER TABLE "INPUT_DOCUMENT"
|
||||||
|
|||||||
@@ -910,7 +910,15 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
|||||||
$Fields['docVersion'] = $_POST['docVersion'];
|
$Fields['docVersion'] = $_POST['docVersion'];
|
||||||
$oInputDocument = new InputDocument();
|
$oInputDocument = new InputDocument();
|
||||||
$InpDocData = $oInputDocument->load( $Fields['DOC_UID'] );
|
$InpDocData = $oInputDocument->load( $Fields['DOC_UID'] );
|
||||||
|
|
||||||
|
$inpDocMaxFilesize = $InpDocData["INP_DOC_MAX_FILESIZE"];
|
||||||
|
$inpDocMaxFilesizeUnit = $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"];
|
||||||
|
$inpDocMaxFilesize = $inpDocMaxFilesize * (($inpDocMaxFilesizeUnit == "MB")? 1024 *1024 : 1024); //Bytes
|
||||||
|
|
||||||
|
$Fields["INP_DOC_MAX_FILESIZE"] = $inpDocMaxFilesize;
|
||||||
|
$Fields["INP_DOC_MAX_FILESIZE_LABEL"] = ($inpDocMaxFilesize > 0)? "[" . $InpDocData["INP_DOC_MAX_FILESIZE"] . " " . $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"] . "]" : "";
|
||||||
$Fields['fileTypes'] = $InpDocData['INP_DOC_TYPE_FILE'];
|
$Fields['fileTypes'] = $InpDocData['INP_DOC_TYPE_FILE'];
|
||||||
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SaveDocument?UID=' . $_POST['docID'] );
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SaveDocument?UID=' . $_POST['docID'] );
|
||||||
G::RenderPage( 'publish', 'raw' );
|
G::RenderPage( 'publish', 'raw' );
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ try {
|
|||||||
if ($arrayFileError[$i] == 0) {
|
if ($arrayFileError[$i] == 0) {
|
||||||
$indocUid = null;
|
$indocUid = null;
|
||||||
$fieldName = null;
|
$fieldName = null;
|
||||||
|
$fileSizeByField = 0;
|
||||||
|
|
||||||
if (is_array( $arrayField[$i] )) {
|
if (is_array( $arrayField[$i] )) {
|
||||||
if (isset( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] )) {
|
if (isset( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] )) {
|
||||||
@@ -262,12 +263,20 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
|
$fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
|
||||||
|
|
||||||
|
if (isset($_FILES["form"]["size"][$arrayField[$i]["grdName"]][$arrayField[$i]["index"]][$arrayField[$i]["grdFieldName"]])) {
|
||||||
|
$fileSizeByField = $_FILES["form"]["size"][$arrayField[$i]["grdName"]][$arrayField[$i]["index"]][$arrayField[$i]["grdFieldName"]];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isset( $_POST["INPUTS"][$arrayField[$i]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]] )) {
|
if (isset( $_POST["INPUTS"][$arrayField[$i]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]] )) {
|
||||||
$indocUid = $_POST["INPUTS"][$arrayField[$i]];
|
$indocUid = $_POST["INPUTS"][$arrayField[$i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
$fieldName = $arrayField[$i];
|
$fieldName = $arrayField[$i];
|
||||||
|
|
||||||
|
if (isset($_FILES["form"]["size"][$fieldName])) {
|
||||||
|
$fileSizeByField = $_FILES["form"]["size"][$fieldName];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($indocUid != null) {
|
if ($indocUid != null) {
|
||||||
@@ -290,6 +299,21 @@ try {
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Validate Filesize of $_FILE
|
||||||
|
$inpDocMaxFilesize = $aID["INP_DOC_MAX_FILESIZE"];
|
||||||
|
$inpDocMaxFilesizeUnit = $aID["INP_DOC_MAX_FILESIZE_UNIT"];
|
||||||
|
|
||||||
|
$inpDocMaxFilesize = $inpDocMaxFilesize * (($inpDocMaxFilesizeUnit == "MB")? 1024 *1024 : 1024); //Bytes
|
||||||
|
|
||||||
|
if ($inpDocMaxFilesize > 0 && $fileSizeByField > 0) {
|
||||||
|
if ($fileSizeByField > $inpDocMaxFilesize) {
|
||||||
|
G::SendMessageText(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"), "ERROR");
|
||||||
|
$arrayAux1 = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
|
||||||
|
G::header("location: /sys" . SYS_SYS . $arrayAux1[1]);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => $indocUid,"APP_DOC_TYPE" => "INPUT","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"FOLDER_UID" => $oFolder->createFromPath( $aID["INP_DOC_DESTINATION_PATH"] ),"APP_DOC_TAGS" => $oFolder->parseTags( $aID["INP_DOC_TAGS"] ),"APP_DOC_FIELDNAME" => $fieldName);
|
$aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => $indocUid,"APP_DOC_TYPE" => "INPUT","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"FOLDER_UID" => $oFolder->createFromPath( $aID["INP_DOC_DESTINATION_PATH"] ),"APP_DOC_TAGS" => $oFolder->parseTags( $aID["INP_DOC_TAGS"] ),"APP_DOC_FIELDNAME" => $fieldName);
|
||||||
} else {
|
} else {
|
||||||
$aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => - 1,"APP_DOC_TYPE" => "ATTACHED","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"APP_DOC_FIELDNAME" => $fieldName);
|
$aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => - 1,"APP_DOC_TYPE" => "ATTACHED","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"APP_DOC_FIELDNAME" => $fieldName);
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ if($res->status == 0){
|
|||||||
|
|
||||||
//Add Input Document
|
//Add Input Document
|
||||||
if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
|
if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
|
||||||
|
try {
|
||||||
$appDocUid = $case->addInputDocument(
|
$appDocUid = $case->addInputDocument(
|
||||||
$inputDocumentUid,
|
$inputDocumentUid,
|
||||||
$appDocUid,
|
$appDocUid,
|
||||||
@@ -121,8 +122,16 @@ if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
|
|||||||
"xmlform",
|
"xmlform",
|
||||||
$_FILES["form"]["name"]["APP_DOC_FILENAME"],
|
$_FILES["form"]["name"]["APP_DOC_FILENAME"],
|
||||||
$_FILES["form"]["error"]["APP_DOC_FILENAME"],
|
$_FILES["form"]["error"]["APP_DOC_FILENAME"],
|
||||||
$_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"]
|
$_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"],
|
||||||
|
$_FILES["form"]["size"]["APP_DOC_FILENAME"]
|
||||||
);
|
);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
G::SendMessageText($e->getMessage(), "ERROR");
|
||||||
|
|
||||||
|
$arrayAux = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
|
||||||
|
G::header("location: /sys" . SYS_SYS . $arrayAux[1]);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) {
|
if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) {
|
||||||
|
|||||||
@@ -45,6 +45,19 @@ try {
|
|||||||
}
|
}
|
||||||
$aFields['INP_DOC_TAGS'] = isset( $aFields['INP_DOC_TAGS'] ) ? $aFields['INP_DOC_TAGS'] : 'INPUT';
|
$aFields['INP_DOC_TAGS'] = isset( $aFields['INP_DOC_TAGS'] ) ? $aFields['INP_DOC_TAGS'] : 'INPUT';
|
||||||
$aFields['INP_DOC_VERSIONING'] = strval( isset( $aFields['INP_DOC_VERSIONING'] ) ? $aFields['INP_DOC_VERSIONING'] : '' );
|
$aFields['INP_DOC_VERSIONING'] = strval( isset( $aFields['INP_DOC_VERSIONING'] ) ? $aFields['INP_DOC_VERSIONING'] : '' );
|
||||||
|
|
||||||
|
$uploadMaxFilesize = 0;
|
||||||
|
$uploadMaxFilesizeUnit = "KB";
|
||||||
|
|
||||||
|
if (preg_match("/^(\d+)(.*)$/", ini_get("upload_max_filesize"), $arrayMatch)) {
|
||||||
|
$uploadMaxFilesize = (int)($arrayMatch[1]);
|
||||||
|
$uploadMaxFilesizeUnit = (strlen(strtoupper($arrayMatch[2])) > 1)? $arrayMatch[2] : $arrayMatch[2] . "B";
|
||||||
|
$uploadMaxFilesize = $uploadMaxFilesize * (($uploadMaxFilesizeUnit == "MB")? 1024 * 1024 : 1024); //Bytes
|
||||||
|
}
|
||||||
|
|
||||||
|
$aFields["INP_DOC_UPLOAD_MAX_FILESIZE"] = $uploadMaxFilesize;
|
||||||
|
$aFields["INP_DOC_UPLOAD_MAX_FILESIZE_LABEL"] = "(" . $arrayMatch[1] . " " . $uploadMaxFilesizeUnit . ")";
|
||||||
|
|
||||||
G::LoadClass( 'xmlfield_InputPM' );
|
G::LoadClass( 'xmlfield_InputPM' );
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'inputdocs/inputdocs_Edit', '', $aFields, '../inputdocs/inputdocs_Save' );
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'inputdocs/inputdocs_Edit', '', $aFields, '../inputdocs/inputdocs_Save' );
|
||||||
|
|||||||
@@ -12,7 +12,10 @@
|
|||||||
<td colspan="2">{$form.APP_DOC_TYPE}</td>
|
<td colspan="2">{$form.APP_DOC_TYPE}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="display: none;">
|
<tr style="display: none;">
|
||||||
<td colspan="2">{$form.DOC_UID}</td>
|
<td colspan="2">
|
||||||
|
{$form.DOC_UID}
|
||||||
|
{$form.INP_DOC_MAX_FILESIZE}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="display: none;">
|
<tr style="display: none;">
|
||||||
<td colspan="2">{$form.APP_DOC_UID}</td>
|
<td colspan="2">{$form.APP_DOC_UID}</td>
|
||||||
@@ -26,6 +29,12 @@
|
|||||||
<tr style="display: none;">
|
<tr style="display: none;">
|
||||||
<td colspan="2">{$form.fileTypes}</td>
|
<td colspan="2">{$form.fileTypes}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="FormLabel" width="{$form_labelWidth}">{$INP_DOC_MAX_FILESIZE_LABEL}</td>
|
||||||
|
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.INP_DOC_MAX_FILESIZE_LABEL}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="FormLabel" width="{$form_labelWidth}">{$APP_DOC_FILENAME}</td>
|
<td class="FormLabel" width="{$form_labelWidth}">{$APP_DOC_FILENAME}</td>
|
||||||
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.APP_DOC_FILENAME} </td> //-->
|
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.APP_DOC_FILENAME} </td> //-->
|
||||||
|
|||||||
@@ -7,6 +7,12 @@
|
|||||||
<actionType type="hidden"/>
|
<actionType type="hidden"/>
|
||||||
<docVersion type="hidden"/>
|
<docVersion type="hidden"/>
|
||||||
<fileTypes type="hidden"/>
|
<fileTypes type="hidden"/>
|
||||||
|
<INP_DOC_MAX_FILESIZE type="hidden" showInTable="0" />
|
||||||
|
|
||||||
|
<INP_DOC_MAX_FILESIZE_LABEL type="text" maxlength="30" validate="Any" size="10" mode="view">
|
||||||
|
<en>Max size accepted</en>
|
||||||
|
</INP_DOC_MAX_FILESIZE_LABEL>
|
||||||
|
|
||||||
<APP_DOC_FILENAME type="file">
|
<APP_DOC_FILENAME type="file">
|
||||||
<en><![CDATA[File]]></en>
|
<en><![CDATA[File]]></en>
|
||||||
</APP_DOC_FILENAME>
|
</APP_DOC_FILENAME>
|
||||||
@@ -31,6 +37,10 @@ leimnud.event.add(window, 'load', function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (getField("INP_DOC_MAX_FILESIZE").value == 0 || getField("INP_DOC_MAX_FILESIZE").value == "") {
|
||||||
|
hideRow("INP_DOC_MAX_FILESIZE_LABEL");
|
||||||
|
}
|
||||||
|
|
||||||
var verifyInfo = function(oForm)
|
var verifyInfo = function(oForm)
|
||||||
{
|
{
|
||||||
oAux = getField('APP_DOC_FILENAME');
|
oAux = getField('APP_DOC_FILENAME');
|
||||||
@@ -41,6 +51,13 @@ var verifyInfo = function(oForm)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var flagFilesize = inputDocumentVerifySize(parseInt(getField("INP_DOC_MAX_FILESIZE").value), getField("APP_DOC_FILENAME"));
|
||||||
|
|
||||||
|
if (flagFilesize == 0) {
|
||||||
|
new leimnud.module.app.alert().make({label: _("ID_SIZE_VERY_LARGE_PERMITTED")});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
docType = oAux.value.split(".");
|
docType = oAux.value.split(".");
|
||||||
docType = docType[docType.length - 1];
|
docType = docType[docType.length - 1];
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,12 @@
|
|||||||
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
|
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
|
||||||
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
|
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||||
<tbody><tr style="display: none;">
|
<tbody>
|
||||||
<td colspan="2">{$form.PRO_UID}</td>
|
<tr style="display: none;">
|
||||||
|
<td colspan="2">
|
||||||
|
{$form.PRO_UID}
|
||||||
|
{$form.INP_DOC_UPLOAD_MAX_FILESIZE}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="display: none;">
|
<tr style="display: none;">
|
||||||
<td colspan="2">{$form.INP_DOC_UID}</td>
|
<td colspan="2">{$form.INP_DOC_UID}</td>
|
||||||
@@ -57,6 +61,12 @@
|
|||||||
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.INP_DOC_TYPE_FILE} </td> //-->
|
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.INP_DOC_TYPE_FILE} </td> //-->
|
||||||
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.INP_DOC_TYPE_FILE}</td>
|
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.INP_DOC_TYPE_FILE}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class='FormLabel' width="{$form_labelWidth}">{$INP_DOC_MAX_FILESIZE}</td>
|
||||||
|
<td class='FormFieldContent' >{$form.INP_DOC_MAX_FILESIZE} {$form.INP_DOC_MAX_FILESIZE_UNIT} {$INP_DOC_UPLOAD_MAX_FILESIZE_LABEL} {$form.INP_DOC_UPLOAD_MAX_FILESIZE_LABEL}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="FormButton" colspan="2" align="center"> <br/> {$form.ACCEPT} {$form.BTN_CANCEL} </td>
|
<td class="FormButton" colspan="2" align="center"> <br/> {$form.ACCEPT} {$form.BTN_CANCEL} </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<dynaForm name="intputdocs/inputdocs_Edit" type="xmlform" width="100%" enableTemplate="1">
|
<dynaForm name="intputdocs/inputdocs_Edit" type="xmlform" width="100%" enableTemplate="1">
|
||||||
<PRO_UID type="hidden" showInTable="0"/>
|
<PRO_UID type="hidden" showInTable="0"/>
|
||||||
<INP_DOC_UID type="hidden" showInTable="0"/>
|
<INP_DOC_UID type="hidden" showInTable="0"/>
|
||||||
|
<INP_DOC_UPLOAD_MAX_FILESIZE type="hidden" showInTable="0" />
|
||||||
<TITLE type="title" group="1">
|
<TITLE type="title" group="1">
|
||||||
<en><![CDATA[Input Document Information]]></en>
|
<en><![CDATA[Input Document Information]]></en>
|
||||||
</TITLE>
|
</TITLE>
|
||||||
@@ -29,6 +30,22 @@
|
|||||||
<INP_DOC_TYPE_FILE type="text" maxlength="200" size="37" colWidth="200" titleAlign="left" align="left" hint="To verify that the content of the file is the correct according to its extension, it is necessary to enable the FILEINFO extension, if this is not enabled only the extension will be verified." dataCompareField="T.CON_VALUE" dataCompareType="contains">
|
<INP_DOC_TYPE_FILE type="text" maxlength="200" size="37" colWidth="200" titleAlign="left" align="left" hint="To verify that the content of the file is the correct according to its extension, it is necessary to enable the FILEINFO extension, if this is not enabled only the extension will be verified." dataCompareField="T.CON_VALUE" dataCompareType="contains">
|
||||||
<en><![CDATA[Allowed file extensions (use *.* to allow any extension)]]></en>
|
<en><![CDATA[Allowed file extensions (use *.* to allow any extension)]]></en>
|
||||||
</INP_DOC_TYPE_FILE>
|
</INP_DOC_TYPE_FILE>
|
||||||
|
|
||||||
|
<INP_DOC_MAX_FILESIZE type="text" maxlength="10" size="8" mode="edit">
|
||||||
|
<en>Maximum file size</en>
|
||||||
|
</INP_DOC_MAX_FILESIZE>
|
||||||
|
|
||||||
|
<INP_DOC_MAX_FILESIZE_UNIT type="dropdown" colWidth="80" titleAlign="left" align="left">
|
||||||
|
<en>
|
||||||
|
<option name="KB">KB</option>
|
||||||
|
<option name="MB">MB</option>
|
||||||
|
</en>
|
||||||
|
</INP_DOC_MAX_FILESIZE_UNIT>
|
||||||
|
|
||||||
|
<INP_DOC_UPLOAD_MAX_FILESIZE_LABEL type="text" maxlength="30" validate="Any" size="10" mode="view">
|
||||||
|
<en>Max upload file size</en>
|
||||||
|
</INP_DOC_UPLOAD_MAX_FILESIZE_LABEL>
|
||||||
|
|
||||||
<BTN_CANCEL type="button" onclick="cancel();">
|
<BTN_CANCEL type="button" onclick="cancel();">
|
||||||
<en><![CDATA[Cancel]]></en>
|
<en><![CDATA[Cancel]]></en>
|
||||||
</BTN_CANCEL>
|
</BTN_CANCEL>
|
||||||
|
|||||||
@@ -44,6 +44,32 @@ var currentPagedTable = @#PAGED_TABLE_ID;
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getField("INP_DOC_MAX_FILESIZE").value.trim() != "") {
|
||||||
|
var maxFilesize = parseInt(getField("INP_DOC_MAX_FILESIZE").value.trim());
|
||||||
|
var maxFilesizeUnit = getField("INP_DOC_MAX_FILESIZE_UNIT").value;
|
||||||
|
|
||||||
|
var uploadMaxFilesize = parseInt(getField("INP_DOC_UPLOAD_MAX_FILESIZE").value);
|
||||||
|
|
||||||
|
maxFilesize = maxFilesize * ((maxFilesizeUnit == "MB")? 1024 * 1024 : 1024);
|
||||||
|
|
||||||
|
if(maxFilesize > 0) {
|
||||||
|
if(maxFilesize > uploadMaxFilesize) {
|
||||||
|
new leimnud.module.app.alert().make({label: _("ID_SIZE_VERY_LARGE_PERMITTED")});
|
||||||
|
getField("INP_DOC_MAX_FILESIZE").focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
new leimnud.module.app.alert().make({label: _("ID_MAXIMUM_SIZE_FILE_GREATER_THAN_ZERO")});
|
||||||
|
getField("INP_DOC_MAX_FILESIZE").focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
new leimnud.module.app.alert().make({label: _("ID_MAXIMUM_SIZE_FILE_REQUIRED")});
|
||||||
|
getField("INP_DOC_MAX_FILESIZE").focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
function inputdocsSave( form ) {
|
function inputdocsSave( form ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user