BUG-5437 New Feature 'Edit the file Name' in HOME -> DOCUMENTS.
I add a new function: UPDATE in 'engine/classes/model/AppFolder.php', and in 'engine/methods/appFolder/appFolderAjax.php' to save the new name of the file.
This commit is contained in:
@@ -23,7 +23,11 @@ if (($_REQUEST['action']) != 'rename') {
|
|||||||
$functionParams = isset ($_REQUEST ['params']) ? $_REQUEST ['params'] : array ();
|
$functionParams = isset ($_REQUEST ['params']) ? $_REQUEST ['params'] : array ();
|
||||||
$oldname = $_REQUEST ['item'];
|
$oldname = $_REQUEST ['item'];
|
||||||
$newname = $_REQUEST ['newitemname'];
|
$newname = $_REQUEST ['newitemname'];
|
||||||
$uid = $_REQUEST ['selitems'];
|
$oUid = $_REQUEST ['selitems'];
|
||||||
|
|
||||||
|
if ((isset($oUid))) {
|
||||||
|
$uid = $oUid[0];
|
||||||
|
}
|
||||||
|
|
||||||
$functionName ($oldname, $newname, $uid);
|
$functionName ($oldname, $newname, $uid);
|
||||||
}
|
}
|
||||||
@@ -33,17 +37,16 @@ if (($_REQUEST['action']) != 'rename') {
|
|||||||
function renameFolder($oldname, $newname, $uid)
|
function renameFolder($oldname, $newname, $uid)
|
||||||
{
|
{
|
||||||
$folder = new AppFolder();
|
$folder = new AppFolder();
|
||||||
|
|
||||||
//Clean Folder name (delete spaces...)
|
//Clean Folder name (delete spaces...)
|
||||||
$newname = trim( $newname );
|
$newname = trim( $newname );
|
||||||
|
|
||||||
$fiels = array();
|
$fields = array();
|
||||||
|
|
||||||
$fiels['FOLDER_UID'] = $uid[0];
|
$fields['FOLDER_UID'] = $uid;
|
||||||
$fiels['FOLDER_NAME'] = $newname;
|
$fields['FOLDER_NAME'] = $newname;
|
||||||
$fiels['FOLDER_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
$fields['FOLDER_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
$folder->update($fiels);
|
$folder->update($fields);
|
||||||
|
|
||||||
$msgLabel= G::LoadTranslation ('ID_EDIT_SUCCESSFULLY');
|
$msgLabel= G::LoadTranslation ('ID_EDIT_SUCCESSFULLY');
|
||||||
echo "{action: '', error:'error',message: '$msgLabel', success: 'success',folderUID: 'root'}";
|
echo "{action: '', error:'error',message: '$msgLabel', success: 'success',folderUID: 'root'}";
|
||||||
|
|||||||
Reference in New Issue
Block a user