mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 23:24:57 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
4363566998
|
@ -626,7 +626,8 @@ switch($command) {
|
|||
break; /* }}} */
|
||||
|
||||
case 'setdocumentname': /* {{{ */
|
||||
if(1||$user) {
|
||||
if($user) {
|
||||
if(checkFormKey('setdocumentname')) {
|
||||
$document = $dms->getDocument($_REQUEST['id']);
|
||||
if($document) {
|
||||
if ($document->getAccessMode($user) >= M_READWRITE) {
|
||||
|
@ -650,6 +651,10 @@ switch($command) {
|
|||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_doc_id'), 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
||||
}
|
||||
}
|
||||
break; /* }}} */
|
||||
|
||||
|
|
|
@ -2426,7 +2426,7 @@ $(function() {
|
|||
if(!empty($this->params['settings']->_inlineEditing)) {
|
||||
echo "<span class=\"editable\" contenteditable=\"true\"";
|
||||
if($object->isType('document'))
|
||||
echo " data-document=\"".$object->getId()."\"";
|
||||
echo " data-document=\"".$object->getId()."\" data-formtoken=\"".createFormKey('setdocumentname')."\"";
|
||||
echo ">".$text;
|
||||
echo "</span>\n";
|
||||
} else
|
||||
|
|
|
@ -2391,7 +2391,7 @@ $(function() {
|
|||
if(!empty($this->params['settings']->_inlineEditing)) {
|
||||
echo "<span class=\"editable\" contenteditable=\"true\"";
|
||||
if($object->isType('document'))
|
||||
echo " data-document=\"".$object->getId()."\"";
|
||||
echo " data-document=\"".$object->getId()."\" data-formtoken=\"".createFormKey('setdocumentname')."\"";
|
||||
echo ">".$text;
|
||||
echo "</span>\n";
|
||||
} else
|
||||
|
|
|
@ -617,9 +617,8 @@ $(document).ready( function() {
|
|||
|
||||
$("body").on("blur", "span.editable", function(e) { /* {{{ */
|
||||
console.log($(this).data('document'));
|
||||
console.log('Hallo'+$(this).text());
|
||||
e.preventDefault();
|
||||
$.post( "../op/op.Ajax.php", { command: "setdocumentname", id: $(this).data('document'), name: $(this).text() })
|
||||
$.post( "../op/op.Ajax.php", { command: "setdocumentname", id: $(this).data('document'), formtoken: $(this).data('formtoken'), name: $(this).text() })
|
||||
.done(function( data ) {
|
||||
noty({
|
||||
text: data.message,
|
||||
|
|
Loading…
Reference in New Issue
Block a user