diff --git a/html/js/scripts.js b/html/js/scripts.js
index d068eaf04..04cc00b1c 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -3955,3 +3955,48 @@ var operation_tag = function (p_div)
});
};
};
+
+/**
+ * Check the sum of size of all the FILES to upload
+ * @param p_object the form DOM object,
+ * @param p_max_size MAX_FILE_SIZE constant (see config.inc.php or constant.php)
+ * @returns true if the sum of filesize is greater than the limit
+ */
+function check_file_size(p_object,p_max_size)
+{
+ var sum_file=0;
+ for(var i=0;i p_max_size) {alert_box(content[78]);return false;}
+ return true;
+}
+
+/**
+ * Check that the receipt file is not too big
+ * @see ajax_ledger.php , ledger_detail_file
+ * @param int p_max_size maximum size
+ * @param p_info name of the waiting box
+ * @returns true if file size is less than the maximum
+ */
+function check_receipt_size(p_max_size,p_info)
+{
+ document.getElementById(p_info).style.display="inline";
+ console.debug ("param p_max_file_size"+p_max_size);
+ var f=document.getElementById("receipt_id");
+ if ( f && f.files[0] && f.files[0].size > parseFloat(p_max_size)) {
+ document.getElementById("receipt_info_id").innerHTML=content[78];
+ document.getElementById(p_info).style.display="none";
+ return false;
+ }
+ document.getElementById("receipt_info_id").innerHTML="";
+ document.getElementById("form_file").submit();
+ return true;
+}
\ No newline at end of file
diff --git a/include/action.common.inc.php b/include/action.common.inc.php
index 4e568e55d..9c5a25e47 100644
--- a/include/action.common.inc.php
+++ b/include/action.common.inc.php
@@ -225,7 +225,8 @@ if ($sub_action == 'detail')
if ($g_user->can_write_action($ag_id) == true)
{
- echo '';
}
else
@@ -285,17 +288,20 @@ case 'file':
{
// Not possible to remove the file thanks a modal dialog box,
// because of the frameset
- $x=sprintf(''."x".'',
- $gDossier,$div,$jr_id);
-
+
+ $x=Icon_Action::trash(uniqid(),
+ sprintf("if (confirm(content[47])) {document.location.href='ajax_misc.php?op=ledger&gDossier=%d&div=%s&jr_id=%s&act=rmf'}",
+ $gDossier,$div,$jr_id));
+
}
$filename= $obj->det->jr_pj_name;
- if ( strlen($obj->det->jr_pj_name) > 20 )
+ if ( strlen($obj->det->jr_pj_name) > 60 )
{
- $filename=mb_substr($obj->det->jr_pj_name,0,23);
+ $filename=mb_substr($obj->det->jr_pj_name,0,60);
}
echo HtmlInput::show_receipt_document($jr_id,h($filename));
echo $x;
+ echo '';
echo '';
echo '