This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, master has been updated
via 2c943c81213993ce1a082b453be454916c8d6296 (commit)
from 54e3aa6425f34ee13f4202573acd2ead74ceae90 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=2c943c81213993ce1a082b453be454916c8d6296
commit 2c943c81213993ce1a082b453be454916c8d6296
Author: Franck Villaume <[email protected]>
Date: Tue Jan 31 13:11:11 2017 +0000
docman: fix edit version when comment or description is multi-line
diff --git a/src/common/docman/DocumentVersionFactory.class.php
b/src/common/docman/DocumentVersionFactory.class.php
index 1c6bf4c..4c28a41 100644
--- a/src/common/docman/DocumentVersionFactory.class.php
+++ b/src/common/docman/DocumentVersionFactory.class.php
@@ -87,7 +87,9 @@ class DocumentVersionFactory extends FFError {
$isHtml = 1;
}
$new_description =
util_gen_cross_ref($arr['description'], $this->Document->Group->getID());
- $arr['new_description'] =
nl2br($new_description);
+ $arr['new_description'] =
str_replace(array("\r\n", "\r", "\n"), "\\n", $new_description);
+ $arr['description'] = str_replace(array("\r\n",
"\r", "\n"), "\\n", $arr['description']);
+ $arr['vcomment'] = str_replace(array("\r\n",
"\r", "\n"), "\\n", $arr['vcomment']);
$arr['versionactions'][] = util_make_link('#',
$HTML->getEditFilePic(_('Edit this version'), 'editversion'), array('id' =>
'version_action_edit', 'onclick' =>
'javascript:controllerListFile.toggleEditVersionView({title:
\''.addslashes($arr['title']).'\', description:
\''.addslashes($arr['description']).'\', new_description:
\''.addslashes($arr['new_description']).'\', version: '.ltrim($arr['version'],
'_').', current_version: '.$arr['current_version'].', isURL: '.$isURL.',
isText: '.$isText.', isHtml: '.$isHtml.', filename:
\''.addslashes($arr['filename']).'\', vcomment:
\''.addslashes($arr['vcomment']).'\', docid: '.$arr['docid'].', groupId:
'.$this->Document->Group->getID().'})'), true);
if ($numrows > 1) {
$arr['versionactions'][] =
util_make_link('#', $HTML->getRemovePic(_('Permanently delete this version'),
'delversion'), array('id' => 'version_action_delete', 'onclick' =>
'javascript:controllerListFile.deleteVersion({version: '.ltrim($arr['version'],
'_').', docid: '.$arr['docid'].', groupId:
'.$this->Document->Group->getID().'})'), true);
diff --git a/src/www/docman/scripts/DocManController.js
b/src/www/docman/scripts/DocManController.js
index 08cb5d6..843bcc5 100644
--- a/src/www/docman/scripts/DocManController.js
+++ b/src/www/docman/scripts/DocManController.js
@@ -449,7 +449,7 @@ DocManListFileController.prototype =
versionactiontdcontent
+= val.versionactions[i];
}
// please sync with the
editfile.php widths if you change it here.
- var htmlString = '<tr
id="docversion'+val.version.substr(1)+'" ><td style="width:
60px">'+val.version.substr(1)+currenttdcontent+'</td><td style="width:
150px">'+filenametdcontent[0].outerHTML+'</td><td style="width:
150px">'+val.title+'</td><td style="width:
150px">'+val.new_description+'</td><td style="width:
110px">'+val.vcomment+'</td><td style="width:
100px">'+val.created_by_username+'</td><td style="width:
100px">'+val.lastdate+'</td><td style="width:
50px">'+val.filesize_readable+'</td><td style="width:
50px">'+versionactiontdcontent+'</td></tr>'
+ var htmlString = '<tr
id="docversion'+val.version.substr(1)+'" ><td style="width:
60px">'+val.version.substr(1)+currenttdcontent+'</td><td style="width:
150px">'+filenametdcontent[0].outerHTML+'</td><td style="width:
150px">'+val.title+'</td><td style="width:
150px">'+val.new_description.replace('\\n', '<br />')+'</td><td style="width:
110px">'+val.vcomment.replace('\\n', '<br />')+'</td><td style="width:
100px">'+val.created_by_username+'</td><td style="width:
100px">'+val.lastdate+'</td><td style="width:
50px">'+val.filesize_readable+'</td><td style="width:
50px">'+versionactiontdcontent+'</td></tr>'
jQuery('#sortable_doc_version_table > tbody:last-child').append(htmlString);
});
}
@@ -655,8 +655,8 @@ DocManListFileController.prototype =
jQuery('#editButtonFile').prop('checked', true);
}
jQuery('#title').val(this.version.title);
- jQuery('#description').val(this.version.description);
- jQuery('#vcomment').val(this.version.vcomment);
+
jQuery('#description').val(this.version.description.replace('\\n',
String.fromCharCode(13,10)));
+
jQuery('#vcomment').val(this.version.vcomment.replace('\\n',
String.fromCharCode(13,10)));
jQuery('#edit_version').val(this.version.version);
if (this.version.current_version == 1) {
jQuery('#current_version').attr('checked',
'checked').prop('checked', true);
-----------------------------------------------------------------------
Summary of changes:
src/common/docman/DocumentVersionFactory.class.php | 4 +++-
src/www/docman/scripts/DocManController.js | 6 +++---
2 files changed, 6 insertions(+), 4 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits