diff --git a/code/ryzom/tools/server/www/webtt/README b/code/ryzom/tools/server/www/webtt/CakePHP_README similarity index 100% rename from code/ryzom/tools/server/www/webtt/README rename to code/ryzom/tools/server/www/webtt/CakePHP_README diff --git a/code/ryzom/tools/server/www/webtt/app/config/database.php b/code/ryzom/tools/server/www/webtt/app/config/database.php index a4183b950..3119752d2 100644 --- a/code/ryzom/tools/server/www/webtt/app/config/database.php +++ b/code/ryzom/tools/server/www/webtt/app/config/database.php @@ -12,7 +12,7 @@ class DATABASE_CONFIG { ); var $raw_files = array( 'datasource' => 'RawFilesSource', - 'path' => '/home/kaczorek/projects/webtt/distfiles/translation', + 'path' => '/path/to/translation', 'extension' => '(uxt|txt)', 'readonly' => true, 'recursive' => true, diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/app_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/app_controller.php index a60584a71..03bfdf4cb 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/app_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/app_controller.php @@ -33,11 +33,16 @@ * @link http://book.cakephp.org/view/957/The-App-Controller */ class AppController extends Controller { - var $components = array('DebugKit.Toolbar', 'Session', 'PathResolver', 'Auth' => array("authorize"=>"controller")); + var $components = array('DebugKit.Toolbar' => array( +// 'panels' => array('variables'=>false) + ), 'Session', 'PathResolver', 'Auth'); var $layout = "new"; function beforeFilter() { parent::beforeFilter(); + $this->Auth->autoRedirect = false; + $this->Auth->authorize = 'controller'; + $this->Auth->userScope = array('User.activated' => true, 'User.confirm_hash' => null); $this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login'); if ($this->Auth->user('role') == "admin") @@ -66,8 +71,5 @@ class AppController extends Controller { ); // $this->log($isAllowed); return $isAllowed; -// } - - } diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/comments_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/comments_controller.php index e6ddb365e..a746622e4 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/comments_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/comments_controller.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +Session->setFlash(__('The comment could not be saved. Please, try again.', true)); } } + $this->set('comment', $comment_data = $this->Comment->read(null, $id)); if (empty($this->data)) { - $this->data = $this->Comment->read(null, $id); + $this->data = $comment_data; } $translations = $this->Comment->Translation->find('list'); $identifiers = $this->Comment->Identifier->find('list'); @@ -119,8 +139,9 @@ class CommentsController extends AppController { $this->Session->setFlash(__('The comment could not be saved. Please, try again.', true)); } } + $this->set('comment', $comment_data = $this->Comment->read(null, $id)); if (empty($this->data)) { - $this->data = $this->Comment->read(null, $id); + $this->data = $comment_data; } $translations = $this->Comment->Translation->find('list'); $identifiers = $this->Comment->Identifier->find('list'); diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/components/path_resolver.php b/code/ryzom/tools/server/www/webtt/app/controllers/components/path_resolver.php index 2fffe0f3f..8dcd96c99 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/components/path_resolver.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/components/path_resolver.php @@ -1,98 +1,42 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +belongsTo as $childModel => $junk) { - $names[] = $this->getAssociationsTree($model->{$childModel}); + if ($model->alias != $model->{$childModel}->alias) + $names[] = $this->getAssociationsTree($model->{$childModel}); } return array($model->alias => $names); } - function node_path ($node_name, $tree) { - foreach ($tree as $name => $val) { - if ($name == $node_name) return $name; - foreach ($val as $subtree) { - $ret = $this->node_path($node_name, $subtree); - if ($ret != '') return "$name => $ret"; - } - } - } - - function findModelPath_old2($name, $assocTree, $path = null) - { -// debug($name, $assocTree, $path); -// debug($name); -// debug($assocTree); -// debug($path); - foreach ($assocTree as $model => $childs) - { - if (!isset($path)) - $path = array($model => ""); - if ($model == $name) - { -// $newPath[$childModel] = $path; -// debug($childModel); - return array($model => $model); -// return $model; - } - foreach ($childs as $childModelArray => $subTree) - { -// debug(array($childModel => $newAssocTree)); -// debug_print_backtrace(); -// if ($ret = $this->findModelPath($name, $subTree, $newPath)) - if ($ret = $this->findModelPath($name, $subTree)) - { - echo "## model: "; var_dump($model); - echo "## key subTree: "; var_dump(key($subTree)); - echo "## ret:\n"; var_dump($ret); -// var_dump(array(key($subTree) => $ret)); -// return array(key($subTree) => $ret); -// return array($model => key($subTree)); -// return array($model => $ret); - return array($model => $ret); - } - } - } -// return $path; - - } - function t($i) { return str_repeat("\t",$i); } - function getAssociationsGraph($name, $assocTree) - { - static $graph = array(); - foreach ($assocTree as $model => $childs) - { - if ($model == $name) - return true; - foreach ($childs as $childModelArray) - { - foreach ($childModelArray as $childModel => $newAssocTree) - { - if ($ret = $this->getAssociationsGraph($name, array($childModel => $newAssocTree))) - { - $graph[$childModel][] = $model; -// var_dump($graph); - } - } - } - } -// var_dump($graph); - return $graph; - } - function findModelPath($name, $assocTree, $path = null) { -// debug($name, $assocTree, $path); -// debug($name); -// debug($assocTree); -// debug($path); foreach ($assocTree as $model => $childs) { if (!isset($path)) @@ -101,12 +45,9 @@ class PathResolverComponent extends Object { { foreach ($childModelArray as $childModel => $newAssocTree) { -// debug(array($childModel => $newAssocTree)); -// debug_print_backtrace(); $newPath[$childModel] = $path; if ($name == $childModel) { -// debug($childModel); return $newPath; } else @@ -117,36 +58,9 @@ class PathResolverComponent extends Object { } } } -// return $path; } - - function printPath($model) - { - if (!isset($model->belongsTo)) - return null; - $assocTree = $this->getAssociationsTree($model); - $path = $this->findModelPath('Language', $assocTree); -// $path = $this->findModelPath('User', $assocTree); -// var_dump($path); -// return 0; - $text = null; - while ($path) - { - $model = key($path); -/* foreach ($path as $model => $childs) - { - $controller = Inflector::pluralize(Inflector::underscore($model)); - } - $path = $childs;*/ - $controller = Inflector::pluralize(Inflector::underscore($model)); - $path = $path[$model]; - $new_path[$controller] = $new_path; - var_dump($new_path); - $text .= " => " . $controller; - } - return $text; - } + function beforeRender($controller) { if (!isset($controller->{$controller->modelClass})) @@ -155,11 +69,10 @@ class PathResolverComponent extends Object { if (!isset($model->belongsTo)) return 0; $assocTree = $this->getAssociationsTree($model); -// var_dump($assocTree); - $path = $this->findModelPath('Language', $assocTree); - if (!$path) - $path = array('Language' => array()); -// var_dump($path); + $rootModel = 'Language'; + $path = $this->findModelPath($rootModel, $assocTree); + if (!$path && $model->alias == $rootModel) + $path = array($rootModel => array()); $controller->set('assocPath', $path); } diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/file_identifiers_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/file_identifiers_controller.php index eabc80e77..fd87e4928 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/file_identifiers_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/file_identifiers_controller.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +set('fileIdentifier', $this->FileIdentifier->read(null, $id)); } - function add() { - if (!empty($this->data)) { - $this->FileIdentifier->create(); - if ($this->FileIdentifier->save($this->data)) { - $this->Session->setFlash(__('The file identifier has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The file identifier could not be saved. Please, try again.', true)); - } - } - $importedTranslationFiles = $this->FileIdentifier->ImportedTranslationFile->find('list'); - $identifiers = $this->FileIdentifier->Identifier->find('list'); - $this->set(compact('importedTranslationFiles', 'identifiers')); - } - - function edit($id = null) { - if (!$id && empty($this->data)) { - $this->Session->setFlash(__('Invalid file identifier', true)); - $this->redirect(array('action' => 'index')); - } - if (!empty($this->data)) { - if ($this->FileIdentifier->save($this->data)) { - $this->Session->setFlash(__('The file identifier has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The file identifier could not be saved. Please, try again.', true)); - } - } - if (empty($this->data)) { - $this->data = $this->FileIdentifier->read(null, $id); - } - $importedTranslationFiles = $this->FileIdentifier->ImportedTranslationFile->find('list'); - $identifiers = $this->FileIdentifier->Identifier->find('list'); - $this->set(compact('importedTranslationFiles', 'identifiers')); - } - - function delete($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid id for file identifier', true)); - $this->redirect(array('action'=>'index')); - } - if ($this->FileIdentifier->delete($id)) { - $this->Session->setFlash(__('File identifier deleted', true)); - $this->redirect(array('action'=>'index')); - } - $this->Session->setFlash(__('File identifier was not deleted', true)); - $this->redirect(array('action' => 'index')); - } - function admin_index() { - $this->FileIdentifier->recursive = 0; - $this->set('fileIdentifiers', $this->paginate()); - } - function admin_view($id = null) { if (!$id) { $this->Session->setFlash(__('Invalid file identifier', true)); @@ -105,8 +71,9 @@ class FileIdentifiersController extends AppController { $this->Session->setFlash(__('The file identifier could not be saved. Please, try again.', true)); } } + $this->set('fileIdentifier', $fileIdentifier_data = $this->FileIdentifier->read(null, $id)); if (empty($this->data)) { - $this->data = $this->FileIdentifier->read(null, $id); + $this->data = $fileIdentifier_data; } $importedTranslationFiles = $this->FileIdentifier->ImportedTranslationFile->find('list'); $identifiers = $this->FileIdentifier->Identifier->find('list'); diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/identifier_columns_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/identifier_columns_controller.php index 19695fa20..0c29ebe22 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/identifier_columns_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/identifier_columns_controller.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +set('identifierColumn', $this->IdentifierColumn->read(null, $id)); } - function add() { - if (!empty($this->data)) { - $this->IdentifierColumn->create(); - if ($this->IdentifierColumn->save($this->data)) { - $this->Session->setFlash(__('The identifier column has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The identifier column could not be saved. Please, try again.', true)); - } - } - $identifiers = $this->IdentifierColumn->Identifier->find('list'); - $this->set(compact('identifiers')); - } - - function edit($id = null) { - if (!$id && empty($this->data)) { - $this->Session->setFlash(__('Invalid identifier column', true)); - $this->redirect(array('action' => 'index')); - } - if (!empty($this->data)) { - if ($this->IdentifierColumn->save($this->data)) { - $this->Session->setFlash(__('The identifier column has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The identifier column could not be saved. Please, try again.', true)); - } - } - if (empty($this->data)) { - $this->data = $this->IdentifierColumn->read(null, $id); - } - $identifiers = $this->IdentifierColumn->Identifier->find('list'); - $this->set(compact('identifiers')); - } - - function delete($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid id for identifier column', true)); - $this->redirect(array('action'=>'index')); - } - if ($this->IdentifierColumn->delete($id)) { - $this->Session->setFlash(__('Identifier column deleted', true)); - $this->redirect(array('action'=>'index')); - } - $this->Session->setFlash(__('Identifier column was not deleted', true)); - $this->redirect(array('action' => 'index')); - } function admin_index() { $this->IdentifierColumn->recursive = 0; $this->set('identifierColumns', $this->paginate()); @@ -102,8 +75,9 @@ class IdentifierColumnsController extends AppController { $this->Session->setFlash(__('The identifier column could not be saved. Please, try again.', true)); } } + $this->set('identifierColumn', $identifierColumn_data = $this->IdentifierColumn->read(null, $id)); if (empty($this->data)) { - $this->data = $this->IdentifierColumn->read(null, $id); + $this->data = $identifierColumn_data; } $identifiers = $this->IdentifierColumn->Identifier->find('list'); $this->set(compact('identifiers')); diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/identifiers_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/identifiers_controller.php index 01c5911e7..57bb7e812 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/identifiers_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/identifiers_controller.php @@ -1,12 +1,27 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +Identifier->recursive = 0; -// Router::connectNamed(array('language')); - $conditions = null; if (isset($this->passedArgs['language']) && $lang = $this->passedArgs['language']) $conditions = array('Identifier.language_id' => $lang); @@ -45,55 +60,11 @@ class IdentifiersController extends AppController { $this->Session->setFlash(__('Invalid identifier', true)); $this->redirect(array('action' => 'index')); } - $this->set('identifier', $this->Identifier->read(null, $id)); + $this->set('identifier', $identifier = $this->Identifier->read(null, $id)); + if ($identifier) + $this->set('identifierNeighbours', $this->Identifier->getNeighbours($id)); } - function add() { - if (!empty($this->data)) { - $this->Identifier->create(); - if ($this->Identifier->save($this->data)) { - $this->Session->setFlash(__('The identifier has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The identifier could not be saved. Please, try again.', true)); - } - } - $languages = $this->Identifier->Language->find('list'); - $this->set(compact('languages')); - } - - function edit($id = null) { - if (!$id && empty($this->data)) { - $this->Session->setFlash(__('Invalid identifier', true)); - $this->redirect(array('action' => 'index')); - } - if (!empty($this->data)) { - if ($this->Identifier->save($this->data)) { - $this->Session->setFlash(__('The identifier has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The identifier could not be saved. Please, try again.', true)); - } - } - if (empty($this->data)) { - $this->data = $this->Identifier->read(null, $id); - } - $languages = $this->Identifier->Language->find('list'); - $this->set(compact('languages')); - } - - function delete($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid id for identifier', true)); - $this->redirect(array('action'=>'index')); - } - if ($this->Identifier->delete($id)) { - $this->Session->setFlash(__('Identifier deleted', true)); - $this->redirect(array('action'=>'index')); - } - $this->Session->setFlash(__('Identifier was not deleted', true)); - $this->redirect(array('action' => 'index')); - } function admin_index() { $this->Identifier->recursive = 0; $this->set('identifiers', $this->paginate()); @@ -104,7 +75,9 @@ class IdentifiersController extends AppController { $this->Session->setFlash(__('Invalid identifier', true)); $this->redirect(array('action' => 'index')); } - $this->set('identifier', $this->Identifier->read(null, $id)); + $this->set('identifier', $identifier = $this->Identifier->read(null, $id)); + if ($identifier) + $this->set('identifierNeighbours', $this->Identifier->getNeighbours($id)); } function admin_add() { @@ -134,8 +107,9 @@ class IdentifiersController extends AppController { $this->Session->setFlash(__('The identifier could not be saved. Please, try again.', true)); } } + $this->set('identifier', $identifier_data = $this->Identifier->read(null, $id)); if (empty($this->data)) { - $this->data = $this->Identifier->read(null, $id); + $this->data = $identifier_data; } $languages = $this->Identifier->Language->find('list'); $this->set(compact('languages')); diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/imported_translation_files_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/imported_translation_files_controller.php index 58296aed4..2a64123bb 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/imported_translation_files_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/imported_translation_files_controller.php @@ -1,8 +1,26 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +ImportedTranslationFile->recursive = 0; $this->set('importedTranslationFiles', $this->paginate()); @@ -14,142 +32,10 @@ class ImportedTranslationFilesController extends AppController { $this->redirect(array('action' => 'index')); } $this->set('importedTranslationFile', $this->ImportedTranslationFile->read(null, $id)); -// var_dump($this->ImportedTranslationFile->RawFile); } - function admin_import($filename = null) { -// $this->view = "index"; - App::import("Vendor","UxtParser", array("file" => 'UxtParser.php')); -/* if (!$filename) { - $this->Session->setFlash(__('Invalid file', true)); - $this->redirect(array('action' => 'index')); - return 0; - }*/ - $filename="diff/pl_diff_4DEC868A.uxt"; - $translationFile = $this->ImportedTranslationFile->find('first', array('conditions' => array('ImportedTranslationFile.filename' => $filename))); - if ($translationFile) - { - $this->Session->setFlash(__('Translation file already imported', true)); - $this->redirect(array('action' => 'index')); - return 0; - } -// var_dump($file); - $parser = new UxtParser(); - $parsedFile = $parser->parseFile($filename); -// var_dump($parsedFile); - $arr = explode("_", basename($filename, ".uxt")); -// var_dump($arr); - $language_id = 1; - - $this->ImportedTranslationFile->create(); - $data['ImportedTranslationFile']['language_id'] = $language_id; - $data['ImportedTranslationFile']['filename'] = $filename; - //$this->ImportedTranslationFile->save($data); - foreach ($parsedFile as $ent) - { - $fi_data = array(); - if ($ent['type'] != "string") - continue; - - - $i_data['language_id'] = $language_id; - $i_data['translation_index'] = $ent['index']; - $i_data['reference_string'] = $ent['string']; - unset($this->ImportedTranslationFile->Language->Identifier->id); - $identifier = $this->ImportedTranslationFile->Language->Identifier->find('first',array('conditions' => array('Identifier.identifier' => $ent['identifier'], 'Identifier.language_id' => $language_id))); - if ($identifier) - { -// var_dump($identifier); - $i_data['id']=$identifier['Identifier']['id']; - } - else - { - $i_data['identifier'] = $ent['identifier']; - $i_data['translated'] = false; - } - var_dump($i_data); - $this->ImportedTranslationFile->Language->Identifier->save(array('Identifier' => $i_data)); - $identifier_id = $this->ImportedTranslationFile->Language->Identifier->id; - var_dump($identifier_id); - - unset($this->ImportedTranslationFile->FileIdentifier->id); - //TODO - set FileIdentifier['id'] if we import already imported file (imported imported file temporarly disabled) -// $identifier = $this->ImportedTranslationFile->FileIdentifier->find('first',array('conditions' => array('FileIdentifier.identifier' => $ent['identifier'], 'FileIdentifier.translation_file_id' => $))); -// $data['FileIdentifier']['translation_file_id'] = $this->ImportedTranslationFile->id; - if ($ent['diff']) - $fi_data['command'] = "DIFF " . mb_strtoupper($ent['diff']); - $fi_data['translation_index'] = $ent['index']; -// $data['FileIdentifier']['identifier_id'] = ; - $fi_data['reference_string'] = $ent['string']; - $fi_data['identifier_id'] = $identifier_id; - -// $this->ImportedTranslationFile->FileIdentifier->create(); -// $this->ImportedTranslationFile->FileIdentifier->save($data); - $data['FileIdentifier'][] = $fi_data; -// $l_data['Language']['id'] = $language_id; -// $l_data['Identifier'][] = $i_data; -// $data['Identifier'][] = $i_data; - } -// var_dump($data); -// $this->ImportedTranslationFile->Language->saveAll($l_data); - $this->ImportedTranslationFile->saveAll($data); - $this->Session->setFlash(__('Translation file imported', true)); - $this->redirect(array('action' => 'view', $this->ImportedTranslationFile->id)); - $this->ImportedTranslationFile->recursive = 0; - $this->set('importedTranslationFiles', $this->paginate()); -// $this->render('index'); - } - - - function add() { - if (!empty($this->data)) { - $this->ImportedTranslationFile->create(); - if ($this->ImportedTranslationFile->save($this->data)) { - $this->Session->setFlash(__('The translation file has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); - } - } - $languages = $this->ImportedTranslationFile->Language->find('list'); - $this->set(compact('languages')); - } - - function edit($id = null) { - if (!$id && empty($this->data)) { - $this->Session->setFlash(__('Invalid translation file', true)); - $this->redirect(array('action' => 'index')); - } - if (!empty($this->data)) { - if ($this->ImportedTranslationFile->save($this->data)) { - $this->Session->setFlash(__('The translation file has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); - } - } - if (empty($this->data)) { - $this->data = $this->ImportedTranslationFile->read(null, $id); - } - $languages = $this->ImportedTranslationFile->Language->find('list'); - $this->set(compact('languages')); - } - - function delete($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid id for translation file', true)); - $this->redirect(array('action'=>'index')); - } - if ($this->ImportedTranslationFile->delete($id)) { - $this->Session->setFlash(__('Translation file deleted', true)); - $this->redirect(array('action'=>'index')); - } - $this->Session->setFlash(__('Translation file was not deleted', true)); - $this->redirect(array('action' => 'index')); - } function admin_index() { $this->ImportedTranslationFile->recursive = 0; -// FireCake::dump("??",$_SERVER); $this->set('importedTranslationFiles', $this->paginate()); } @@ -188,8 +74,9 @@ class ImportedTranslationFilesController extends AppController { $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); } } + $this->set('importedTranslationFile', $importedTranslationFile_data = $this->ImportedTranslationFile->read(null, $id)); if (empty($this->data)) { - $this->data = $this->ImportedTranslationFile->read(null, $id); + $this->data = $importedTranslationFile_data; } $languages = $this->ImportedTranslationFile->Language->find('list'); $this->set(compact('languages')); diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/languages_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/languages_controller.php index 53e8405d1..7b0626316 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/languages_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/languages_controller.php @@ -1,14 +1,29 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +Language->recursive = 0; $this->set('languages', $this->paginate()); @@ -22,48 +37,6 @@ class LanguagesController extends AppController { $this->set('language', $this->Language->read(null, $id)); } - function add() { - if (!empty($this->data)) { - $this->Language->create(); - if ($this->Language->save($this->data)) { - $this->Session->setFlash(__('The language has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The language could not be saved. Please, try again.', true)); - } - } - } - - function edit($id = null) { - if (!$id && empty($this->data)) { - $this->Session->setFlash(__('Invalid language', true)); - $this->redirect(array('action' => 'index')); - } - if (!empty($this->data)) { - if ($this->Language->save($this->data)) { - $this->Session->setFlash(__('The language has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The language could not be saved. Please, try again.', true)); - } - } - if (empty($this->data)) { - $this->data = $this->Language->read(null, $id); - } - } - - function delete($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid id for language', true)); - $this->redirect(array('action'=>'index')); - } - if ($this->Language->delete($id)) { - $this->Session->setFlash(__('Language deleted', true)); - $this->redirect(array('action'=>'index')); - } - $this->Session->setFlash(__('Language was not deleted', true)); - $this->redirect(array('action' => 'index')); - } function admin_index() { $this->Language->recursive = 0; $this->set('languages', $this->paginate()); @@ -102,8 +75,9 @@ class LanguagesController extends AppController { $this->Session->setFlash(__('The language could not be saved. Please, try again.', true)); } } + $this->set('language', $language_data = $this->Language->read(null, $id)); if (empty($this->data)) { - $this->data = $this->Language->read(null, $id); + $this->data = $language_data; } } diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/pages_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/pages_controller.php index e669a9113..a6d2362b6 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/pages_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/pages_controller.php @@ -89,12 +89,10 @@ class PagesController extends AppController { /* if (isset($this->params['admin'])) array_shift($path);*/ -//var_dump($path); if (!isset($path[0]) || $path[0] != 'admin') { //This adds admin to the beginning of the path so the pages controller will look in the 'admin' folder in pages directory $path = array_merge((array)'admin', $path); } -// var_dump($path); $count = count($path); if (!$count) { $this->redirect('/'); diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/raw_files_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/raw_files_controller.php index 618110db2..0620a1312 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/raw_files_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/raw_files_controller.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +RawFile->recursive = 1; -// var_dump($this->RawFile->find('count')); -// $db =& ConnectionManager::getDataSource($this->RawFile->useDbConfig); -// var_dump($db->calculate($this->RawFile, 'count')); $conditions['RawFile.dir'] = array("diff","translated"); $this->set('rawFiles', $this->paginate($conditions)); -// $this->log(Router::parse($this->referer())); -// var_dump($this->paginate()); } function admin_listdir($extension = null) { $this->RawFile->recursive = 0; $this->set('rawFiles', $this->paginate(array("RawFile.extension" => $extension))); $this->rendeR("admin_index"); -// var_dump($this->paginate()); } function admin_view($dir = null, $filename = null) { @@ -34,8 +47,6 @@ class RawFilesController extends AppController { $this->redirect(array('action' => 'index')); return 0; } -// $id = $dir . DS . $filename; -// $this->set('rawFile', $this->RawFile->read(null, $id)); $this->set('rawFile', $rawFile = $this->RawFile->find('first', array( "conditions" => array( "RawFile.dir" => $dir, @@ -46,13 +57,7 @@ class RawFilesController extends AppController { $this->set('fileContent', $this->RawFile->_currentFile->read()); } -/* function import($dir = null, $filename = null) { - $this->admin_import($dir, $filename); - }*/ - function admin_import($dir = null, $filename = null) { -// $this->view = "index"; -// App::import("Vendor","UxtParser", array("file" => 'UxtParser.php')); if (!$filename) { $this->Session->setFlash(__('Invalid file', true)); $this->redirect(array('action' => 'index')); @@ -67,28 +72,19 @@ class RawFilesController extends AppController { $importedTranslationFileModel = $this->RawFile->ImportedTranslationFile; $translationFileModel = $importedTranslationFileModel->TranslationFile; $languageModel = $translationFileModel->Language; -// $identifierModel = $languageModel->Identifier; $identifierModel = $translationFileModel->Identifier; $identifierColumnModel = $identifierModel->IdentifierColumn; $translationModel = $identifierModel->Translation; $fileIdentifierModel = $importedTranslationFileModel->FileIdentifier; -// $filename="diff/pl_diff_4DEC868A.uxt"; $importedTranslationFile = $importedTranslationFileModel->find('first', array('conditions' => array('ImportedTranslationFile.filename' => $dir . DS . $filename), "recursive" => -1)); -/* var_dump($translationFile); - return 0;*/ if ($importedTranslationFile) { $this->Session->setFlash(__('Translation file already imported', true)); $this->redirect(array('action' => 'index')); return 0; } -// var_dump($file); -// $parser = new UxtParser(); -// $arr = explode("_", basename($filename, ".uxt")); -// var_dump($arr); -// $language_id = 1; $languageCode = $this->RawFile->getLanguageCode($filename); if (!$languageCode) { @@ -104,10 +100,6 @@ class RawFilesController extends AppController { $this->redirect(array('action' => 'index')); return 0; } - else - { -// var_dump($language_id); - } $filename_template = preg_replace('/_diff/', '', $filename); $filename_template = preg_replace('/_[A-F0-9]{8}/', '', $filename_template); @@ -137,18 +129,12 @@ class RawFilesController extends AppController { $translation_file_id = $translationFileModel->id; $parsedFile = $this->RawFile->parseFile(); -/* var_dump($parsedFile); - $this->render('index'); - return 0;*/ -// $this->log($parsedFile); if (!$parsedFile) { $this->Session->setFlash(__('Error importing file', true)); $this->redirect(array('action' => 'index')); return 0; } -// $this->log($parsedFile); -// return 0; ini_set('max_execution_time',0); @@ -160,11 +146,9 @@ class RawFilesController extends AppController { $data['ImportedTranslationFile']['filename'] = $dir . DS . $filename; $data['ImportedTranslationFile']['file_last_modified_date'] = $this->RawFile->_currentFileLastChange; -// $data['TranslationFile'] = $tf_data; $importedTranslationFileModel->saveAll($data); $importedTranslationFile_id = $importedTranslationFileModel->id; - //$this->ImportedTranslationFile->save($data); foreach ($parsedFile as $ent) { if (!isset($ent['type'])) @@ -188,23 +172,25 @@ class RawFilesController extends AppController { if (isset($ent['arguments'])) $i_data['arguments'] = $ent['arguments']; - if (isset($ent['diff']) && isset($ent['string'])) + if (isset($ent['columns']) && is_array($ent['columns']) && !isset($ent['string'])) + { + foreach ($ent['columns'] as $column_no => $value) + { + $ent['string'] .= $value . "\t"; + } + $ent['string'] = substr($ent['string'], 0, -1); + } + + if (isset($ent['diff'])) { $i_data['reference_string'] = $ent['string']; } unset($identifierModel->id); $identifier = $identifierModel->find('first',array('conditions' => array('Identifier.identifier' => $ent['identifier'], 'Identifier.translation_file_id' => $translation_file_id), 'contain' => 'IdentifierColumn')); - //App::import('Vendor', 'DebugKit.FireCake'); -// FireCake::log($ent['identifier'], "Identifier"); -// FireCake::dump("identifier",$identifier); -/* $this->log($ent['identifier']); - $this->log($identifier);*/ if ($identifier) { -// var_dump($identifier); $i_data['id']=$identifier['Identifier']['id']; -// $this->log("found"); } else { @@ -213,28 +199,51 @@ class RawFilesController extends AppController { if (isset($ent['diff'])) $i_data['translated'] = false; $newIdentifier = true; -// $this->log("not found"); -// $this->log("id: # " . $identifierModel->id . " #"); -// $this->log($i_data); - } -// var_dump($i_data); $res = $identifierModel->saveAll($tarr = array('Identifier' => $i_data)); $identifier_id = $identifierModel->id; -/* $this->log('identifier saveAll res'); - $this->log($res); - $this->log(var_export($res,true)); - $this->log($identifierModel->validationErrors); - $this->log($identifierModel); - $this->log('#identifier id'); - $this->log($identifier_id); - $this->log("tarr"); - $this->log($tarr);*/ + + if (!isset($ent['diff'])) // it is translated file and we add translation + { + unset($translationModel->id); + unset($t_data); + $translationHash = $translationModel->makeHash($ent); + + if ($newIdentifier) // ovbiously there's no translation for identifier we just created + $translation = array(); + else + { + $this->log('new translation check'); + $this->log($translationHash); + $translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_id' => $identifier_id, 'Translation.translation_text' => $ent["string"], 'Translation.translation_hash' => NULL), "recursive" => -1)); + $this->log($translation); + if (!$translation) + { + $translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_id' => $identifier_id, 'Translation.translation_hash' => $translationHash), "recursive" => -1)); + $this->log($translation); + } + $this->log('new translation check end'); + } + + if (!$translation) + { + $this->log('new translation'); + $t_data['identifier_id'] = $identifier_id; + $t_data['translation_text'] = $ent['string']; + $t_data['user_id'] = $this->Auth->user('id'); + $t_data['translation_hash'] = $translationHash; + $translationModel->save(array('Translation' => $t_data)); + } +/* else + $t_data['id'] = $translation['Translation']['id'];*/ + if ($translation) + $parentTranslation_id = $translation['Translation']['id']; + else + $parentTranslation_id = $translationModel->id; + } if (isset($ent['columns']) && is_array($ent['columns'])) { -/* $this->log($_columns); - $this->log($ent['columns']);*/ $ic_data = array(); foreach ($ent['columns'] as $column_no => $value) { @@ -242,8 +251,6 @@ class RawFilesController extends AppController { $ic_arr = array(); $ic_arr['identifier_id'] = $identifier_id; $column_name = $_columns[$column_no]; -/* $this->log($identifier); - $this->log($column_name);*/ if (!$newIdentifier) { foreach ($identifier['IdentifierColumn'] as $identifierColumn_no => $identifierColumn) @@ -259,61 +266,29 @@ class RawFilesController extends AppController { if (isset($ent['diff'])) $ic_arr['reference_string'] = $value; $ic_data[] = $ic_arr; -// $this->log($ic_arr); $res = $identifierColumnModel->save($ic_arr); -// $this->log($res); $identifierColumn_id = $identifierColumnModel->id; -/* $this->log($identifierColumnModel->validationErrors); - $this->log(var_export($res,true));*/ if (!isset($ent['diff'])) // it is translated file and we add translation { unset($translationModel->id); + unset($t_data); if ($newIdentifier) // ovbiously there's no translation for identifier we just created $translation = array(); else - $translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_column_id' => $identifierColumn_id, 'Translation.translation_text' => $value), "recursive" => -1)); + $translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_column_id' => $identifierColumn_id, 'Translation.translation_text' => $value, 'Translation.parent_id' => $parentTranslation_id), "recursive" => -1)); if (!$translation) { $t_data['identifier_column_id'] = $identifierColumn_id; $t_data['translation_text'] = $value; - // TODO: change user_id for authorized user - $t_data['user_id'] = 1; + $t_data['user_id'] = $this->Auth->user('id'); + $t_data['parent_id'] = $parentTranslation_id; + $translationModel->save(array('Translation' => $t_data)); } - else - $t_data['id'] = $translation['Translation']['id']; -// var_dump($i_data); - $translationModel->save(array('Translation' => $t_data)); +/* else + $t_data['id'] = $translation['Translation']['id'];*/ } - - } -/* $res = $identifierColumnModel->saveAll($tarr = array('IdentifierColumn' => $ic_data)); - $this->log($tarr); - $this->log(var_export($res,true)); - $this->log($identifierColumnModel->validationErrors);*/ - } - else - { - if (!isset($ent['diff'])) // it is translated file and we add translation - { - unset($translationModel->id); - if ($newIdentifier) // ovbiously there's no translation for identifier we just created - $translation = array(); - else - $translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_id' => $identifier_id, 'Translation.translation_text' => $ent["string"]), "recursive" => -1)); - if (!$translation) - { - $t_data['identifier_id'] = $identifier_id; - if (isset($ent['string'])) // sheets doesn't have string (they have columns) - $t_data['translation_text'] = $ent['string']; - // TODO: change user_id for authorized user - $t_data['user_id'] = 1; - } - else - $t_data['id'] = $translation['Translation']['id']; -// var_dump($i_data); - $translationModel->save(array('Translation' => $t_data)); } } @@ -341,35 +316,19 @@ class RawFilesController extends AppController { if (isset($ent['index'])) $fi_data['translation_index'] = $ent['index']; -// $data['FileIdentifier']['identifier_id'] = ; $fi_data['identifier_id'] = $identifier_id; $res = $fileIdentifierModel->saveAll($tarr = array('FileIdentifier' => $fi_data)); -// $this->log($res); -/* $this->log("#fi_data"); - $this->log($fi_data);*/ $fileIdentifier_id = $fileIdentifierModel->id; } -// $this->ImportedTranslationFile->FileIdentifier->create(); -// $this->ImportedTranslationFile->FileIdentifier->save($data); -// $data['FileIdentifier'][] = $fi_data; -// $l_data['Language']['id'] = $language_id; -// $l_data['Identifier'][] = $i_data; -// $data['Identifier'][] = $i_data; - $processedEntities++; } -/* $this->render('admin_index'); - return 0;*/ -// var_dump($data); -// $this->ImportedTranslationFile->Language->saveAll($l_data); if ($processedEntities == 0) { $importedTranslationFileModel->delete($importedTranslationFile_id); $this->Session->setFlash(__('File was not imported because it seems empty', true)); -// $this->redirect(array('action' => 'index')); $this->redirect($this->referer()); return 0; } @@ -377,26 +336,20 @@ class RawFilesController extends AppController { { $this->Session->setFlash(__('Translation file imported into database successfully. Processed entities: ' . $processedEntities, true)); $this->redirect(array('controller' => 'imported_translation_files', 'action' => 'view', $importedTranslationFileModel->id)); -// $this->render('admin_index'); return 0; } -// $this->ImportedTranslationFile->recursive = 0; -// $this->set('importedTranslationFiles', $this->paginate()); -// $this->render('index'); } function admin_export($dir = null, $filename = null, $importedTranslationFileId = null) { if (!$filename) { $this->Session->setFlash(__('Invalid file', true)); $this->redirect($this->referer()); -// $this->redirect(array('action' => 'index')); return 0; } if (!$this->RawFile->open($dir, $filename, $writable = true)) { $this->Session->setFlash(__('Can\'t open file for writing', true)); $this->redirect($this->referer()); -// $this->redirect(array('action' => 'index')); return 0; } @@ -414,24 +367,19 @@ class RawFilesController extends AppController { 'conditions' => array( 'ImportedTranslationFile.filename' => $dir . DS . $filename ), -// 'recursive' => 3 -// 'order' => 'FileIdentifier.translation_index', ) ); -/* var_dump($translationFile); - return 0;*/ if (!$importedTranslationFile) { $this->Session->setFlash(__('No imported translation file found for chosen file', true)); $this->redirect($this->referer()); -// $this->redirect(array('controller' => 'imported_translation_files', 'action' => 'index')); return 0; } $translationFileModel = $importedTranslationFileModel->TranslationFile; $identifierModel = $translationFileModel->Identifier; - // TODO: check if all identifiers have "best" translation + // check if all identifiers have "best" translation $identifier_ids = $identifierModel->withoutBestTranslation(array('ImportedTranslationFile.id' => $importedTranslationFile['ImportedTranslationFile']['id'])); if ($identifier_ids === false) { @@ -476,16 +424,11 @@ class RawFilesController extends AppController { 'index' => ((isset($fileIdentifier['translation_index']) && !empty($fileIdentifier['translation_index'])) ? $fileIdentifier['translation_index'] : null), 'internal_index' => $i++, 'type' => ((count($fileIdentifier['Identifier']['IdentifierColumn']) > 0) ? 'sheet' : 'string'), -// 'type' => ((isset($fileIdentifier['command']) && !empty($fileIdentifier['command'])) ? $fileIdentifier['command'] : null), 'identifier' => $fileIdentifier['Identifier']['identifier'], 'arguments' => ((isset($fileIdentifier['arguments']) && !empty($fileIdentifier['arguments'])) ? $fileIdentifier['arguments'] : null), -// 'string' => '', ); -// $this->log($fileIdentifier['Identifier']['Translation']); -// if (Set::numeric(array_keys($fileIdentifier['Identifier']['Translation']))) if (isset($fileIdentifier['Identifier']['Translation'][0])) { -// $this->log('numeric'); $ent['string'] = $fileIdentifier['Identifier']['Translation'][0]['translation_text']; } else if (isset($fileIdentifier['Identifier']['Translation']['translation_text'])) @@ -501,9 +444,6 @@ class RawFilesController extends AppController { foreach ($fileIdentifier['Identifier']['IdentifierColumn'] as $column_no => $identifierColumn) { -/* if (isset($identifierColumn['Translation']['translation_text'])) - $ent['columns'][$column_no] = $identifierColumn['Translation']['translation_text'];*/ - if (isset($identifierColumn['Translation'][0])) $ent['columns'][$column_no] = $identifierColumn['Translation'][0]['translation_text']; else if (isset($identifierColumn['Translation']['translation_text'])) @@ -522,33 +462,10 @@ class RawFilesController extends AppController { $entities[] = $ent; } -/* $sources = ConnectionManager::sourceList(); - $sqlLogs = array(); - foreach ($sources as $source) - { - $db =& ConnectionManager::getDataSource($source); - if (!$db->isInterfaceSupported('getLog')) - continue; - $sqlLogs[$source] = $db->getLog(); - } - $this->log($sqlLogs);*/ - -// $this->log($importedTranslationFile); -/* $this->log($sortResult); - $this->log($entities);*/ ini_set('max_execution_time',0); $result = $this->RawFile->buildFile($entities); -// $this->log($result); -// $this->render('admin_index'); -// $this->redirect(array('controller' => 'imported_translation_files', 'action' => 'index')); -// return 0; - -/* var_dump($parsedFile); - $this->render('index'); - return 0;*/ -// $this->log($parsedFile); if (!$result) { $this->Session->setFlash(__('Error exporting file', true)); diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/translation_files_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/translation_files_controller.php index 4af5324c1..dc386711b 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/translation_files_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/translation_files_controller.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +set('translationFile', $this->TranslationFile->read(null, $id)); } - function add() { - if (!empty($this->data)) { - $this->TranslationFile->create(); - if ($this->TranslationFile->save($this->data)) { - $this->Session->setFlash(__('The translation file has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); - } - } - $languages = $this->TranslationFile->Language->find('list'); - $this->set(compact('languages')); - } - - function edit($id = null) { - if (!$id && empty($this->data)) { - $this->Session->setFlash(__('Invalid translation file', true)); - $this->redirect(array('action' => 'index')); - } - if (!empty($this->data)) { - if ($this->TranslationFile->save($this->data)) { - $this->Session->setFlash(__('The translation file has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); - } - } - if (empty($this->data)) { - $this->data = $this->TranslationFile->read(null, $id); - } - $languages = $this->TranslationFile->Language->find('list'); - $this->set(compact('languages')); - } - - function delete($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid id for translation file', true)); - $this->redirect(array('action'=>'index')); - } - if ($this->TranslationFile->delete($id)) { - $this->Session->setFlash(__('Translation file deleted', true)); - $this->redirect(array('action'=>'index')); - } - $this->Session->setFlash(__('Translation file was not deleted', true)); - $this->redirect(array('action' => 'index')); - } function admin_index() { $this->TranslationFile->recursive = 0; $this->set('translationFiles', $this->paginate()); @@ -106,8 +79,9 @@ class TranslationFilesController extends AppController { $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); } } + $this->set('translationFile', $translationFile_data = $this->TranslationFile->read(null, $id)); if (empty($this->data)) { - $this->data = $this->TranslationFile->read(null, $id); + $this->data = $translationFile_data; } $languages = $this->TranslationFile->Language->find('list'); $this->set(compact('languages')); diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/translations_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/translations_controller.php index f50e265d5..875799e10 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/translations_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/translations_controller.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +Session->setFlash(__('Invalid translation', true)); $this->redirect(array('action' => 'index')); } -// $this->recursive=2; $this->set('translation', $translation = $this->Translation->read(null, $id)); - $this->set('identifier', $identifier = $this->Translation->Identifier->read(null, $translation['Translation']['identifier_id'])); -// var_dump($translation); -// var_dump($identifier); + if (isset($translation['Translation']['identifier_id'])) + { + $this->set('identifier', $identifier = $this->Translation->Identifier->read(null, $translation['Translation']['identifier_id'])); + $this->set('columnTranslations', $columnTranslations = $this->Translation->find('all', array('conditions' => array('Translation.parent_id' => $translation['Translation']['id']), 'order' => 'Translation.id'))); + } + if ($identifier_id = $translation['Translation']['identifier_id']) + $this->set('identifierNeighbours', $this->Translation->Identifier->getNeighbours($identifier_id)); } function add() { if (!empty($this->data)) { $this->Translation->create(); - if ($res = $this->Translation->save($this->data)) { + if ($this->data['ChildTranslation']) + { + unset($translationText); + foreach ($this->data['ChildTranslation'] as $num => $childTranslation) + { + $ent['columns'][] = $childTranslation['translation_text']; + $translationText .= $childTranslation['translation_text'] . "\t"; + } + $this->data['Translation']['translation_text'] = substr($translationText, 0, -1); + } + else + $ent['string'] = $this->data['Translation']['translation_text']; + sort($ent['columns']); + $this->data['Translation']['translation_hash'] = $this->Translation->makeHash($ent); + $this->data['Identifier']['id'] = $this->data['Translation']['identifier_id']; + $this->data['Identifier']['translated'] = 1; + $res = $this->Translation->saveAll($this->data); + $this->log($this->data); + if ($res) { $this->Session->setFlash(__('The translation has been saved', true)); - $this->redirect(array('action' => 'index', 'identifier_id' => $res['Translation']['identifier_id'])); + if ($this->params['form']['Next']) + { + $identifier_id = $this->data['Translation']['identifier_id']; + $identifier = $this->Translation->Identifier->read(null, $identifier_id); + $identifierNeighbors = $this->Translation->Identifier->find('neighbors', array('field' => 'id', 'value' => $identifier_id, 'conditions' => array('translation_file_id' => $identifier['Identifier']['translation_file_id']))); + if ($nextIdentifier = $identifierNeighbors['next']) + $this->redirect(array('action' => 'add', 'identifier_id' => $nextIdentifier['Identifier']['id'])); + else + $this->redirect(array('controller' => 'identifiers', 'action' => 'index', 'translation_file_id' => $identifier['Identifier']['translation_file_id'])); + } + else + $this->redirect(array('controller' => 'identifiers', 'action' => 'view', $this->data['Translation']['identifier_id'])); } else { $this->Session->setFlash(__('The translation could not be saved. Please, try again.', true)); } @@ -36,15 +87,17 @@ class TranslationsController extends AppController { if (empty($this->passedArgs['identifier_id'])) { $this->Session->setFlash(__('You need to choose identifier for translation', true)); - $this->redirect(array('controller' => 'identifiers', 'action' => 'index')); + $this->redirect($this->referer()); } else { $identifier_id = $this->passedArgs['identifier_id']; $this->set('identifier', $identifier = $this->Translation->Identifier->read(null, $identifier_id)); -// $this->data['Translation.identifier_id'] = $identifier_id; + $this->set('identifierNeighbours', $this->Translation->Identifier->getNeighbours($identifier_id)); + $this->set('identifierColumns', $identifierColumns = $this->Translation->IdentifierColumn->find('list', array('conditions' => array('identifier_id' => $identifier_id), 'order' => 'IdentifierColumn.id'))); + if ($identifierColumns) + $this->set('identifierColumnsDetails', Set::combine($this->Translation->IdentifierColumn->find('all', array('conditions' => array('identifier_id' => $identifier_id), 'order' => 'IdentifierColumn.id')), '{n}.IdentifierColumn.id', '{n}.IdentifierColumn')); } -// $identifiers = $this->Translation->Identifier->find('list', array('recursive' => -1)); $users = $this->Translation->User->find('list'); $this->set(compact('identifiers', 'users')); } @@ -55,19 +108,51 @@ class TranslationsController extends AppController { $this->redirect(array('action' => 'index')); } if (!empty($this->data)) { - if ($this->Translation->save($this->data)) { + if ($this->data['ChildTranslation']) + { + unset($translationText); + foreach ($this->data['ChildTranslation'] as $num => $childTranslation) + { + $ent['columns'][] = $childTranslation['translation_text']; + $translationText .= $childTranslation['translation_text'] . "\t"; + } + $this->data['Translation']['translation_text'] = substr($translationText, 0, -1); + } + else + $ent['string'] = $this->data['Translation']['translation_text']; + $this->data['Translation']['translation_hash'] = $this->Translation->makeHash($ent); + $this->data['Identifier']['id'] = $this->data['Translation']['identifier_id']; + $this->data['Identifier']['translated'] = 1; + if ($this->Translation->saveAll($this->data)) { $this->Session->setFlash(__('The translation has been saved', true)); - $this->redirect(array('action' => 'index')); + $this->redirect(array('controller' => 'identifiers', 'action' => 'view', $this->data['Translation']['identifier_id'])); } else { $this->Session->setFlash(__('The translation could not be saved. Please, try again.', true)); } } + $this->set('translation', $translation_data = $this->Translation->read(null, $id)); if (empty($this->data)) { - $this->data = $this->Translation->read(null, $id); + $this->data = $translation_data; + } + $identifier_id= $translation_data['Translation']['identifier_id']; + $this->set('identifierNeighbours', $this->Translation->Identifier->getNeighbours($identifier_id)); + $this->set('identifierColumns', $identifierColumns = $this->Translation->IdentifierColumn->find('list', array('conditions' => array('identifier_id' => $identifier_id), 'order' => 'IdentifierColumn.id'))); + if ($identifierColumns) + { + $contain = array('Translation' => array( + 'conditions' => array('Translation.parent_id' => $translation_data['Translation']['id']), + )); + $identifierColumnsAll = $this->Translation->IdentifierColumn->find('all', array('conditions' => array('identifier_id' => $identifier_id), 'order' => 'IdentifierColumn.id', 'contain' => $contain)); + foreach ($translation_data['ChildTranslation'] as $childTranslationKey => $childTranslation) + { + $mapChildTranslationsColumns[$childTranslation['identifier_column_id']] = $childTranslationKey; + + } + $this->set(compact('mapChildTranslationsColumns')); + $this->set('identifierColumnsDetails', Set::combine($identifierColumnsAll, '{n}.IdentifierColumn.id', '{n}.IdentifierColumn')); + $this->set('identifierColumnTranslations', Set::combine($translation_data['ChildTranslation'], '{n}.identifier_column_id'));//, '{n}.identifier_column_id')); } -// var_dump($this->data); $identifier = $this->Translation->Identifier->read(null, $this->data['Translation']['identifier_id']); - $identifiers = $this->Translation->Identifier->find('list'); $users = $this->Translation->User->find('list'); $this->set(compact('identifiers', 'users', 'identifier')); } @@ -79,7 +164,6 @@ class TranslationsController extends AppController { } if ($this->Translation->delete($id)) { $this->Session->setFlash(__('Translation deleted', true)); -// $this->redirect(array('action'=>'index')); $this->redirect($this->referer()); } $this->Session->setFlash(__('Translation was not deleted', true)); @@ -99,52 +183,18 @@ class TranslationsController extends AppController { else $this->Session->setFlash(__('Set error', true)); $this->redirect($this->referer()); -// $this->index(); -// $this->render('index'); } function admin_view($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid translation', true)); - $this->redirect(array('action' => 'index')); - } - $this->set('translation', $this->Translation->read(null, $id)); + return $this->view($id); } function admin_add() { - if (!empty($this->data)) { - $this->Translation->create(); - if ($this->Translation->save($this->data)) { - $this->Session->setFlash(__('The translation has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The translation could not be saved. Please, try again.', true)); - } - } - $identifiers = $this->Translation->Identifier->find('list'); - $users = $this->Translation->User->find('list'); - $this->set(compact('identifiers', 'users')); + return $this->add(); } function admin_edit($id = null) { - if (!$id && empty($this->data)) { - $this->Session->setFlash(__('Invalid translation', true)); - $this->redirect(array('action' => 'index')); - } - if (!empty($this->data)) { - if ($this->Translation->save($this->data)) { - $this->Session->setFlash(__('The translation has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The translation could not be saved. Please, try again.', true)); - } - } - if (empty($this->data)) { - $this->data = $this->Translation->read(null, $id); - } - $identifiers = $this->Translation->Identifier->find('list'); - $users = $this->Translation->User->find('list'); - $this->set(compact('identifiers', 'users')); + return $this->edit($id); } function admin_delete($id = null) { diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/users_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/users_controller.php index 5c8cbcb70..adc42655b 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/users_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/users_controller.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +set('user', $this->User->read(null, $id)); } - function add() { - if (!empty($this->data)) { - $this->User->create(); - if ($this->User->save($this->data)) { - $this->Session->setFlash(__('The user has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The user could not be saved. Please, try again.', true)); - } - } - } - - function edit($id = null) { - if (!$id && empty($this->data)) { - $this->Session->setFlash(__('Invalid user', true)); - $this->redirect(array('action' => 'index')); - } - if (!empty($this->data)) { - if ($this->User->save($this->data)) { - $this->Session->setFlash(__('The user has been saved', true)); - $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The user could not be saved. Please, try again.', true)); - } - } - if (empty($this->data)) { - $this->data = $this->User->read(null, $id); - } - } - - function delete($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid id for user', true)); - $this->redirect(array('action'=>'index')); - } - if ($this->User->delete($id)) { - $this->Session->setFlash(__('User deleted', true)); - $this->redirect(array('action'=>'index')); - } - $this->Session->setFlash(__('User was not deleted', true)); - $this->redirect(array('action' => 'index')); - } function admin_index() { $this->User->recursive = 0; $this->set('users', $this->paginate()); @@ -98,8 +75,9 @@ class UsersController extends AppController { $this->Session->setFlash(__('The user could not be saved. Please, try again.', true)); } } + $this->set('user', $user_data = $this->User->read(null, $id)); if (empty($this->data)) { - $this->data = $this->User->read(null, $id); + $this->data = $user_data; } } @@ -117,6 +95,32 @@ class UsersController extends AppController { } function login() { + if (!empty($this->data)) + { + $user = $this->User->find('first', array('conditions' => array('User.username' => $this->data['User']['username']))); + $this->log($user); + if ($user['User']['confirm_hash']) + { + $this->Session->delete('Message.auth'); + $this->Session->setFlash('This account is not yet confirmed. Please use confirmation link from email to finalize registration.'); + $this->redirect($this->referer()); + } + if (!$user['User']['activated']) + { + $this->Session->delete('Message.auth'); + $this->Session->setFlash('This account is not yet activated. Please wait until administrator activates your account.'); + $this->redirect($this->referer()); + } + + } + if (!(empty($this->data)) && $this->Auth->user()) + { + $this->log('a'); + $this->User->id = $this->Auth->user('id'); + $this->User->saveField('last_login', date('Y-m-d H:i:s')); + $this->redirect($this->Auth->redirect()); + } + $this->log('b'); } function logout() { @@ -131,16 +135,10 @@ class UsersController extends AppController { function register() { if(!empty($this->data)) { $this->User->create(); -/* $assigned_password = 'newpass'; - $this->data['User']['password'] = $this->Auth->password($assigned_password);*/ $this->data['User']['password'] = $this->Auth->password($this->data['User']['passwd']); $this->data['User']['confirm_hash'] = $this->Auth->password($this->data['User']['name'] . time()); if($user = $this->User->save($this->data)) { // send signup email containing password to the user -// $this->Session->setFlash('your password is ' . $assigned_password); -// $this->Session->setFlash('your password is ' . var_export($this->data['User']['password'], true)); -// $this->Auth->login($this->data); -// $this->Email->delivery = 'debug'; $this->Email->from = 'webtt-noreply@openlink.pl'; $this->Email->to = $user['User']['email']; $this->Email->subject = 'WebTT registration'; @@ -149,10 +147,9 @@ class UsersController extends AppController { $this->set('user', $this->data); $this->set('serverName', $_SERVER['SERVER_NAME']); $this->params['url']['ext'] = 'no_debug'; -// var_dump($this->helpers); unset($this->helpers['DebugKit.Toolbar']); $this->Email->send(); - $this->Session->setFlash('Thank you for registreation. Please use confirm link from email to finalize registration.'); + $this->Session->setFlash('Thank you for registrating. Please use confirmation link from email to finalize registration.'); $this->redirect('/'); } } @@ -168,7 +165,7 @@ class UsersController extends AppController { } $this->User->id = $user['User']['id']; $this->User->save(array('confirm_hash' => null)); - $this->Session->setFlash('Thank you for registreation. You can now log in.'); + $this->Session->setFlash('Thank you for registrating. You will be able to log in after your account is activated by administrator.'); $this->redirect('/'); } } diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/votes_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/votes_controller.php index 7be099b29..7a0e0bb9e 100644 --- a/code/ryzom/tools/server/www/webtt/app/controllers/votes_controller.php +++ b/code/ryzom/tools/server/www/webtt/app/controllers/votes_controller.php @@ -1,18 +1,33 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +Vote->recursive = 0; -// var_dump($this->Vote->belongsTo); -// var_dump($this->Vote->getAssociated()); -// $model = $this->{$this->modelClass}; -// $this->log($tree=$this->PathResolver->getAssociationsTree($model)); -// $this->log($this->PathResolver->getAssociationsGraph('User',$tree)); -// $this->log($this->PathResolver->printPath($model), 'info'); -// $this->log($this->PathResolver->node_path('Language', $tree)); - $this->set('votes', $this->paginate()); + $conditions = null; + if (isset($this->passedArgs['translation_id']) && $translation_id = $this->passedArgs['translation_id']) + $conditions = array('Vote.translation_id' => $translation_id); + $this->set('votes', $this->paginate($conditions)); } function view($id = null) { @@ -39,14 +54,14 @@ class VotesController extends AppController { } function vote() { - if (empty($this->passedArgs['translation'])) + if (empty($this->passedArgs['translation_id'])) { $this->Session->setFlash(__('You need to choose translation for your vote', true)); $this->redirect(array('controller' => 'translations', 'action' => 'index')); } else { - $translation_id = $this->passedArgs['translation']; + $translation_id = $this->passedArgs['translation_id']; $translation = $this->Vote->Translation->read(null, $translation_id); if (!$translation) { @@ -55,16 +70,13 @@ class VotesController extends AppController { } $vote = array("Vote" => array( 'translation_id' => $translation_id, - // TODO: authorized user - 'user_id' => 1, + 'user_id' => $this->Auth->user('id'), ), ); $this->Vote->create(); $this->Vote->save($vote); $this->Session->setFlash(__('Vote added', true)); - $this->redirect($this->referer(array('controller' => 'translations', 'action' => 'index'))); -// $this->redirect(array('controller' => 'translations', 'action' => 'index')); -// $this->data['Translation.identifier_id'] = $identifier_id; + $this->redirect($this->referer()); } } diff --git a/code/ryzom/tools/server/www/webtt/app/models/app_model.php b/code/ryzom/tools/server/www/webtt/app/models/app_model.php index 9def128fd..82b358feb 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/app_model.php +++ b/code/ryzom/tools/server/www/webtt/app/models/app_model.php @@ -32,7 +32,9 @@ * @subpackage cake.cake.libs.model */ class AppModel extends Model { -// var $useDbConfig = 'raw_files'; +// var $recursive = 0; + var $scaffoldForbiddenActions = null; var $scaffoldActions = null; + var $scaffoldForbiddenFields = null; } diff --git a/code/ryzom/tools/server/www/webtt/app/models/behaviors/null.php b/code/ryzom/tools/server/www/webtt/app/models/behaviors/null.php new file mode 100644 index 000000000..6e8b406c9 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/models/behaviors/null.php @@ -0,0 +1,39 @@ +settings[$model->name] = $config; + } + + /** + * Enter description here... + * + * @param AppModel $model + */ + function beforeSave(&$model) + { + foreach ($this->settings[$model->name] as $field) + { + if( + true === array_key_exists($field,$model->data[$model->name]) && + true === empty($model->data[$model->name][$field]) && + 0 === strlen($model->data[$model->name][$field]) ) + { + $model->data[$model->name][$field] = null; + } + } + return true; + } +} +?> diff --git a/code/ryzom/tools/server/www/webtt/app/models/comment.php b/code/ryzom/tools/server/www/webtt/app/models/comment.php index f7419d50d..94e51f1df 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/comment.php +++ b/code/ryzom/tools/server/www/webtt/app/models/comment.php @@ -1,10 +1,28 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + "fk"); - //The Associations below have been created with all possible keys, those that are not needed can be removed var $belongsTo = array( /* 'Translation' => array( diff --git a/code/ryzom/tools/server/www/webtt/app/models/datasources/raw_files_source.php b/code/ryzom/tools/server/www/webtt/app/models/datasources/raw_files_source.php index cc8ed26e4..b775a09bc 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/datasources/raw_files_source.php +++ b/code/ryzom/tools/server/www/webtt/app/models/datasources/raw_files_source.php @@ -1,34 +1,23 @@ 'Datasources.CsvSource', - * 'path' => '/path/to/file', // Path - * 'extension' => 'csv', // File extension - * 'readonly' => true, // Mark for read only access - * 'recursive' => false // Only false is supported at the moment - * ); - */ +/* + Ryzom Core Web-Based Translation Tool + Copyright (C) 2011 Piotr Kaczmarek + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array( diff --git a/code/ryzom/tools/server/www/webtt/app/models/identifier.php b/code/ryzom/tools/server/www/webtt/app/models/identifier.php index 5f4d2da69..14796c74f 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/identifier.php +++ b/code/ryzom/tools/server/www/webtt/app/models/identifier.php @@ -1,20 +1,29 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array( - 'numeric' => array( - 'rule' => array('numeric'), - 'message' => 'Your custom message here', - 'allowEmpty' => false, - //'required' => true, - //'last' => false, // Stop validation after this rule - //'on' => 'create', // Limit validation to 'create' or 'update' operations - ), - ),*/ 'identifier' => array( 'A_Za_z0_9' => array( 'rule' => '/[A-Za-z0-9_@]+/', @@ -29,16 +38,7 @@ class Identifier extends AppModel { var $scaffoldForbiddenActions = array("add", "admin_add", "edit", "admin_edit", "delete", "admin_delete"); - //The Associations below have been created with all possible keys, those that are not needed can be removed - var $belongsTo = array( -/* 'Language' => array( - 'className' => 'Language', - 'foreignKey' => 'language_id', - 'conditions' => '', - 'fields' => '', - 'order' => '' - ),*/ 'TranslationFile' => array( 'className' => 'TranslationFile', 'foreignKey' => 'translation_file_id', @@ -130,4 +130,15 @@ class Identifier extends AppModel { else return false; } + + function getNeighbours($id) + { + $identifierNeighbours['current'][] = $this->read(null, $id); + if ($identifierNeighbours['current']) + { + $identifierNeighbours['prev'] = $this->find('all', array('order' => 'Identifier.id DESC', 'limit' => 5, 'conditions' => array('Identifier.translation_file_id' => $identifierNeighbours['current'][0]['Identifier']['translation_file_id'], 'Identifier.id <' => $identifierNeighbours['current'][0]['Identifier']['id']))); + $identifierNeighbours['next'] = $this->find('all', array('order' => 'Identifier.id ASC', 'limit' => 5, 'conditions' => array('Identifier.translation_file_id' => $identifierNeighbours['current'][0]['Identifier']['translation_file_id'], 'Identifier.id >' => $identifierNeighbours['current'][0]['Identifier']['id']))); + } + return $identifierNeighbours; + } } diff --git a/code/ryzom/tools/server/www/webtt/app/models/identifier_column.php b/code/ryzom/tools/server/www/webtt/app/models/identifier_column.php index c6770212b..abb038407 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/identifier_column.php +++ b/code/ryzom/tools/server/www/webtt/app/models/identifier_column.php @@ -1,12 +1,30 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array( 'className' => 'Identifier', diff --git a/code/ryzom/tools/server/www/webtt/app/models/imported_translation_file.php b/code/ryzom/tools/server/www/webtt/app/models/imported_translation_file.php index 4a816da63..9c4021977 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/imported_translation_file.php +++ b/code/ryzom/tools/server/www/webtt/app/models/imported_translation_file.php @@ -1,22 +1,32 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array( - 'className' => 'Language', - 'foreignKey' => 'language_id', - 'conditions' => '', - 'fields' => '', - 'order' => '' - ), 'TranslationFile' => array( 'className' => 'TranslationFile', 'foreignKey' => 'translation_file_id', diff --git a/code/ryzom/tools/server/www/webtt/app/models/language.php b/code/ryzom/tools/server/www/webtt/app/models/language.php index bd82c0fcb..bc8bdadcd 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/language.php +++ b/code/ryzom/tools/server/www/webtt/app/models/language.php @@ -1,10 +1,28 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array( @@ -20,32 +38,5 @@ class Language extends AppModel { 'finderQuery' => '', 'counterQuery' => '' ), - 'ImportedTranslationFile' => array( - 'className' => 'ImportedTranslationFile', - 'foreignKey' => 'language_id', - 'dependent' => false, - 'conditions' => '', - 'fields' => '', - 'order' => '', - 'limit' => '', - 'offset' => '', - 'exclusive' => '', - 'finderQuery' => '', - 'counterQuery' => '' - ), - 'Identifier' => array( - 'className' => 'Identifier', - 'foreignKey' => 'language_id', - 'dependent' => false, - 'conditions' => '', - 'fields' => '', - 'order' => '', - 'limit' => '', - 'offset' => '', - 'exclusive' => '', - 'finderQuery' => '', - 'counterQuery' => '' - ), ); - } diff --git a/code/ryzom/tools/server/www/webtt/app/models/raw_file.php b/code/ryzom/tools/server/www/webtt/app/models/raw_file.php index 8911bab90..b1a72e26c 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/raw_file.php +++ b/code/ryzom/tools/server/www/webtt/app/models/raw_file.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array( @@ -18,21 +36,6 @@ class RawFile extends AppModel { 'order' => '' ), ); -/* var $hasOne = array( - 'FileIdentifier' => array( - 'className' => 'FileIdentifier', - 'foreignKey' => 'translation_file_id', - 'dependent' => true, - 'conditions' => '', - 'fields' => '', - 'order' => '', - 'limit' => '', - 'offset' => '', - 'exclusive' => '', - 'finderQuery' => '', - 'counterQuery' => '' - ) - );*/ public function open($dir, $filename, $write = false) { @@ -47,7 +50,6 @@ class RawFile extends AppModel { return false; if ($write && !$file->writable()) return false; -// var_dump($filename); $this->_currentFile = $file; $this->_currentFileLastChange = $file->lastChange(); return $file; @@ -55,7 +57,6 @@ class RawFile extends AppModel { public function parseFile() { -// var_dump($this->_currentFile); if (!$this->_currentFile) return false; @@ -93,7 +94,6 @@ class RawFile extends AppModel { public function buildFile($entities) { -// var_dump($this->_currentFile); if (!$this->_currentFile) return false; @@ -133,7 +133,6 @@ class RawFile extends AppModel { public function getLanguageCode($filename) { -// var_dump($filename); if (preg_match('|^([a-z]{2})_diff_[A-F0-9]{8}\.uxt$|', $filename, $matches)) return $matches[1]; else if (preg_match('|^([a-z]{2})\.uxt$|', $filename, $matches)) diff --git a/code/ryzom/tools/server/www/webtt/app/models/translation.php b/code/ryzom/tools/server/www/webtt/app/models/translation.php index 6c8ecafdc..fd481f1e9 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/translation.php +++ b/code/ryzom/tools/server/www/webtt/app/models/translation.php @@ -1,11 +1,29 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + "fk", "index" => "fk"); - //The Associations below have been created with all possible keys, those that are not needed can be removed var $belongsTo = array( 'Identifier' => array( @@ -28,7 +46,14 @@ class Translation extends AppModel { 'conditions' => '', 'fields' => '', 'order' => '' - ) + ), + 'ParentTranslation' => array( + 'className' => 'Translation', + 'foreignKey' => 'parent_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ), ); var $hasMany = array( @@ -58,6 +83,19 @@ class Translation extends AppModel { 'finderQuery' => '', 'counterQuery' => '' ),*/ + 'ChildTranslation' => array( + 'className' => 'Translation', + 'foreignKey' => 'parent_id', + 'dependent' => false, + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'limit' => '', + 'offset' => '', + 'exclusive' => '', + 'finderQuery' => '', + 'counterQuery' => '' + ), ); function setBest() @@ -80,8 +118,18 @@ class Translation extends AppModel { ), )); $this->log($ret); - // TODO: test! return $this->id; } + + function makeHash($ent) + { + if (isset($ent['columns']) && is_array($ent['columns'])) + { + sort($ent['columns']); + return md5(serialize($ent['columns'])); + } + else if (isset($ent['string'])) + return md5($ent['string']); + } } diff --git a/code/ryzom/tools/server/www/webtt/app/models/translation_file.php b/code/ryzom/tools/server/www/webtt/app/models/translation_file.php index d972e88ac..ef4ed9421 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/translation_file.php +++ b/code/ryzom/tools/server/www/webtt/app/models/translation_file.php @@ -1,12 +1,29 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array( 'className' => 'Language', diff --git a/code/ryzom/tools/server/www/webtt/app/models/user.php b/code/ryzom/tools/server/www/webtt/app/models/user.php index 0daa4b852..75dde4d62 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/user.php +++ b/code/ryzom/tools/server/www/webtt/app/models/user.php @@ -1,15 +1,38 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array('confirm_hash')); + + var $recursive = 0; + var $validate = array( 'username' => array( 'alphaNumeric', -/* 'uniqueCheck' => array( + 'uniqueCheck' => array( 'rule' => 'isUnique', 'message' => 'That username has already been taken.', - ),*/ + ), ), 'email' => array('rule' => 'email', 'message' => 'Wrong format'), 'name' => array('rule' => 'notEmpty'), @@ -18,8 +41,7 @@ class User extends AppModel { ); var $scaffoldForbiddenActions = array("add", "edit", "delete"); - - //The Associations below have been created with all possible keys, those that are not needed can be removed + var $scaffoldForbiddenFields = array("" => array("activated","password","confirm_hash","created","modified"),/* "admin_" => array("password")*/); var $hasMany = array( 'Translation' => array( @@ -47,7 +69,20 @@ class User extends AppModel { 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' - ) + ), + 'Comment' => array( + 'className' => 'Comment', + 'foreignKey' => 'user_id', + 'dependent' => false, + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'limit' => '', + 'offset' => '', + 'exclusive' => '', + 'finderQuery' => '', + 'counterQuery' => '' + ), ); } diff --git a/code/ryzom/tools/server/www/webtt/app/models/vote.php b/code/ryzom/tools/server/www/webtt/app/models/vote.php index f03d6b910..18737144d 100644 --- a/code/ryzom/tools/server/www/webtt/app/models/vote.php +++ b/code/ryzom/tools/server/www/webtt/app/models/vote.php @@ -1,10 +1,28 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + array( diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/PhraseParser.php b/code/ryzom/tools/server/www/webtt/app/vendors/PhraseParser.php index 4e63870dd..91da72a72 100644 --- a/code/ryzom/tools/server/www/webtt/app/vendors/PhraseParser.php +++ b/code/ryzom/tools/server/www/webtt/app/vendors/PhraseParser.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> + + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +\n\n"; } $line_no=1; + +/* var_dump(setlocale(LC_ALL,NULL)); + var_dump(setlocale(LC_ALL,'pl_PL.UTF-8'));*/ + // Need to set UTF-8 locale to get str_getcsv to work with UTF-8 cyryllic + setlocale(LC_ALL,'pl_PL.UTF-8'); + foreach ($lines as $line) { if ($this->debug) @@ -36,11 +61,6 @@ class SheetParser // var_dump($line); $line = rtrim($line,"\r\n"); -/* var_dump(setlocale(LC_ALL,NULL)); - var_dump(setlocale(LC_ALL,'pl_PL.UTF-8'));*/ - // Need to set UTF-8 locale to get str_getcsv to work with UTF-8 cyryllic - setlocale(LC_ALL,'pl_PL.UTF-8') - $parsedLine = $this->parseLine($line); if (!$line || mb_strpos($line, "DIFF NOT") === 0 || mb_strpos($line, "REMOVE THE") === 0) diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/StringParser.php b/code/ryzom/tools/server/www/webtt/app/vendors/StringParser.php index e559c0ba6..f2b4bc184 100644 --- a/code/ryzom/tools/server/www/webtt/app/vendors/StringParser.php +++ b/code/ryzom/tools/server/www/webtt/app/vendors/StringParser.php @@ -1,4 +1,23 @@ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +?> +debug) echo "DODANIE \n"; $parsedEnt += $parsedLine; - $parsedEnt['string'] .= "\n"; +// $parsedEnt['string'] .= "\n"; } if ($this->debug) diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/form.ctp b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/form.ctp index 58b63a389..1845005c0 100644 --- a/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/form.ctp +++ b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/form.ctp @@ -23,7 +23,6 @@ ?>
+ + element('neighbours'); ?>
diff --git a/code/ryzom/tools/server/www/webtt/app/views/identifiers/edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/identifiers/edit.ctp index 291860a41..6d4155106 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/identifiers/edit.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/identifiers/edit.ctp @@ -27,7 +27,8 @@
- + + element('neighbours'); ?>

diff --git a/code/ryzom/tools/server/www/webtt/app/views/identifiers/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/identifiers/index.ctp index 5687d8579..51338e607 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/identifiers/index.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/identifiers/index.ctp @@ -7,11 +7,11 @@
@@ -19,6 +19,7 @@
+

Choose an identifier you want to translate and click "View details and comments" to see details and its translations or use shortcut actions, ie. "Add Translation", "List Translations", "Add Comment".

tableHeaders(array($paginator->sort('id'),$paginator->sort('translation_file_id'),$paginator->sort('identifier'),$paginator->sort('arguments'),$paginator->sort('reference_string'),$paginator->sort('translated'),__('Actions', true),)); echo ''.$tableHeaders.''; ?> diff --git a/code/ryzom/tools/server/www/webtt/app/views/identifiers/view.ctp b/code/ryzom/tools/server/www/webtt/app/views/identifiers/view.ctp index b6790e74d..84a9d13f4 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/identifiers/view.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/identifiers/view.ctp @@ -1,37 +1,40 @@
-
- +

You can see translations for this identifier in "Related Translations" section. Click "View" on the list to see translation details. Click "New related Translation" below the list to add one.

@@ -103,6 +106,46 @@
+ + + + + + + + + + + + > + + + + + + + + +
+ + +
+
    +
+
+
@@ -195,7 +240,8 @@
    -
  • Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'identifier_id' => $identifier['Identifier']['id']));?>
  • +
  • Html->link(sprintf(__('List related %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index', 'identifier_id' => $identifier['Identifier']['id']));?>
  • +
  • Html->link(sprintf(__('New related %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'identifier_id' => $identifier['Identifier']['id']));?>
diff --git a/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/admin_index.ctp b/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/admin_index.ctp index e0278b9cf..c120af9c5 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/admin_index.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/admin_index.ctp @@ -25,7 +25,7 @@

- tableHeaders(array($paginator->sort('id'),$paginator->sort('language_id'),$paginator->sort('filename'),$paginator->sort('merged'),$paginator->sort('file_last_modified_date'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); +
tableHeaders(array($paginator->sort('id'),$paginator->sort('translation_file_id'),$paginator->sort('filename'),$paginator->sort('merged'),$paginator->sort('file_last_modified_date'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); echo ''.$tableHeaders.''; ?> > diff --git a/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/admin_view.ctp b/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/admin_view.ctp index ce984a1f1..5c176d6a4 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/admin_view.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/admin_view.ctp @@ -44,9 +44,9 @@
-
+
- Html->link($importedTranslationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $importedTranslationFile['Language']['id'])); ?> + Html->link($importedTranslationFile['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $importedTranslationFile['TranslationFile']['id'])); ?>
@@ -137,7 +137,6 @@
    -
diff --git a/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/index.ctp index 57f041dfc..f3fb264e5 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/index.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/imported_translation_files/index.ctp @@ -38,7 +38,7 @@ > diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/add.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages.bak/add.ctp deleted file mode 100644 index 23eed9eb2..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/add.ctp +++ /dev/null @@ -1,22 +0,0 @@ -
-Form->create('Language');?> -
- - Form->input('name'); - echo $this->Form->input('code'); - ?> -
-Form->end(__('Submit', true));?> -
-
-

-
    - -
  • Html->link(__('List Languages', true), array('action' => 'index'));?>
  • -
  • Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?>
  • -
-
\ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_add.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_add.ctp deleted file mode 100644 index d4e5e1034..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_add.ctp +++ /dev/null @@ -1,22 +0,0 @@ -
-Form->create('Language');?> -
- - Form->input('name'); - echo $this->Form->input('code'); - ?> -
-Form->end(__('Submit', true));?> -
-
-

-
    - -
  • Html->link(__('List Languages', true), array('action' => 'index'));?>
  • -
  • Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?>
  • -
-
\ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_edit.ctp deleted file mode 100644 index f68d48baa..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_edit.ctp +++ /dev/null @@ -1,24 +0,0 @@ -
-Form->create('Language');?> -
- - Form->input('id'); - echo $this->Form->input('name'); - echo $this->Form->input('code'); - ?> -
-Form->end(__('Submit', true));?> -
-
-

-
    - -
  • Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value('Language.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('Language.id'))); ?>
  • -
  • Html->link(__('List Languages', true), array('action' => 'index'));?>
  • -
  • Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?>
  • -
-
\ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_index.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_index.ctp deleted file mode 100644 index e18bb771c..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_index.ctp +++ /dev/null @@ -1,57 +0,0 @@ -
-

-
- Html->link($importedTranslationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $importedTranslationFile['Language']['id'])); ?> + Html->link($importedTranslationFile['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $importedTranslationFile['TranslationFile']['id'])); ?> - Html->link($importedTranslationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $importedTranslationFile['Language']['id'])); ?> + Html->link($importedTranslationFile['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $importedTranslationFile['TranslationFile']['id'])); ?>
- - - - - - - - - - > - - - - - - - - -
Paginator->sort('id');?>Paginator->sort('name');?>Paginator->sort('code');?>Paginator->sort('created');?>Paginator->sort('modified');?>
      - Html->link(__('View', true), array('action' => 'view', $language['Language']['id'])); ?> - Html->link(__('Edit', true), array('action' => 'edit', $language['Language']['id'])); ?> - Html->link(__('Delete', true), array('action' => 'delete', $language['Language']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $language['Language']['id'])); ?> -
-

- Paginator->counter(array( - 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) - )); - ?>

- -
- Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?> - | Paginator->numbers();?> - | - Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?> -
-
-
-

-
    -
  • Html->link(__('New Language', true), array('action' => 'add')); ?>
  • -
  • Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?>
  • -
-
\ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_view.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_view.ctp deleted file mode 100644 index aa7f2c923..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/admin_view.ctp +++ /dev/null @@ -1,133 +0,0 @@ -
-

-
- > - > - -   - - > - > - -   - - > - > - -   - - > - > - -   - - > - > - -   - -
-
-
-

-
    -
  • Html->link(__('Edit Language', true), array('action' => 'edit', $language['Language']['id'])); ?>
  • -
  • Html->link(__('Delete Language', true), array('action' => 'delete', $language['Language']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $language['Language']['id'])); ?>
  • -
  • Html->link(__('List Languages', true), array('action' => 'index')); ?>
  • -
  • Html->link(__('New Language', true), array('action' => 'add')); ?>
  • -
  • Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?>
  • -
-
- - diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages.bak/edit.ctp deleted file mode 100644 index 5eab47bb4..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/edit.ctp +++ /dev/null @@ -1,24 +0,0 @@ -
-Form->create('Language');?> -
- - Form->input('id'); - echo $this->Form->input('name'); - echo $this->Form->input('code'); - ?> -
-Form->end(__('Submit', true));?> -
-
-

-
    - -
  • Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value('Language.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('Language.id'))); ?>
  • -
  • Html->link(__('List Languages', true), array('action' => 'index'));?>
  • -
  • Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?>
  • -
-
\ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages.bak/index.ctp deleted file mode 100644 index 64cdf3bb4..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/index.ctp +++ /dev/null @@ -1,53 +0,0 @@ -
-

- - - - - - - - - - - > - - - - - - - - -
Paginator->sort('id');?>Paginator->sort('name');?>Paginator->sort('code');?>Paginator->sort('created');?>Paginator->sort('modified');?>
      - Html->link(__('View', true), array('action' => 'view', $language['Language']['id'])); ?> -
-

- Paginator->counter(array( - 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) - )); - ?>

- -
- Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?> - | Paginator->numbers();?> - | - Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?> -
-
-
-

-
    -
  • Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?>
  • -

  • -
  • Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?>
  • -
-
\ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/view.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages.bak/view.ctp deleted file mode 100644 index 8560bc864..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/languages.bak/view.ctp +++ /dev/null @@ -1,114 +0,0 @@ -
-

-
- > - > - -   - - > - > - -   - - > - > - -   - - > - > - -   - - > - > - -   - -
-
-
-

-
    -
  • Html->link(__('List Languages', true), array('action' => 'index')); ?>
  • -

  • -
  • Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?>
  • -

  • -
  • Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?>
  • -
-
- - diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages/add.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages/add.ctp index 34124ee82..3315b4f4a 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/languages/add.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/languages/add.ctp @@ -1,22 +1,17 @@
+
+Form->end(__('Submit', true));?> +
diff --git a/code/ryzom/tools/server/www/webtt/app/views/languages/admin_add.ctp b/code/ryzom/tools/server/www/webtt/app/views/languages/admin_add.ctp index ab56f03bb..64cc85c80 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/languages/admin_add.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/languages/admin_add.ctp @@ -1,27 +1,17 @@
+ +
diff --git a/code/ryzom/tools/server/www/webtt/app/views/layouts/default.ctp.bak b/code/ryzom/tools/server/www/webtt/app/views/layouts/default.ctp.bak deleted file mode 100644 index ee4c977be..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/layouts/default.ctp.bak +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Html->charset(); ?> - - <?php __('Ryzom Core: Web Translation Tool :: '); ?> - <?php echo $title_for_layout; ?> - - Html->meta('icon'); - - echo $this->Html->css('cake.generic'); - - echo $scripts_for_layout; - ?> - - -
- -
- - Session->flash(); ?> - - - -
- -
- element('sql_dump'); ?> - - \ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/layouts/email/html/empty b/code/ryzom/tools/server/www/webtt/app/views/layouts/email/html/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/ryzom/tools/server/www/webtt/app/views/layouts/email/text/empty b/code/ryzom/tools/server/www/webtt/app/views/layouts/email/text/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/ryzom/tools/server/www/webtt/app/views/layouts/new.ctp b/code/ryzom/tools/server/www/webtt/app/views/layouts/new.ctp index 761e4d8c8..c47f19055 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/layouts/new.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/layouts/new.ctp @@ -15,6 +15,17 @@ echo $this->Html->script(array('jquery-1.3.2.min.js', 'jquery-ui.js', 'jquery-fluid16.js')); echo $scripts_for_layout; ?> + @@ -46,35 +57,44 @@ - -
-
-
-
/ - Html->link(__(Inflector::pluralize($model), true), array('controller' => $controller, 'action' => 'index')); - if ($path) - echo " / "; - } - ?> -
-
-
-
-
-
+
+
+ if (isset($assocPath)) { + ?> +
+
/ + Html->link(__(Inflector::pluralize($model), true), array('controller' => $controller, 'action' => 'index')); + if ($path) + echo " / "; + } + ?> +
+
+ +
+ Session->read('Auth.User.id')) + echo $this->Html->link(__('Logout', true), array('admin' => false, 'controller' => 'users', 'action' => 'logout')); + else if ($this->params['controller'] == 'users') + echo $this->Html->link(__('Register', true), array('admin' => false, 'controller' => 'users', 'action' => 'register')); + ?> +
+
+
+
+
+
diff --git a/code/ryzom/tools/server/www/webtt/app/views/pages/empty b/code/ryzom/tools/server/www/webtt/app/views/pages/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/ryzom/tools/server/www/webtt/app/views/pages/home.ctp b/code/ryzom/tools/server/www/webtt/app/views/pages/home.ctp index fb895390b..4746aa692 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/pages/home.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/pages/home.ctp @@ -18,7 +18,7 @@ */ ?>
-

+

Click the link below to list the languages in the project.

Html->link(__('List Languages', true), array('controller' => 'languages', 'action' => 'index')); ?>

diff --git a/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_view.ctp b/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_view.ctp index 26d64c899..883355dc9 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_view.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_view.ctp @@ -143,7 +143,6 @@ - @@ -165,7 +164,6 @@ - diff --git a/code/ryzom/tools/server/www/webtt/app/views/translation_files/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/translation_files/index.ctp index 20dfa8676..411739e17 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/translation_files/index.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/translation_files/index.ctp @@ -9,11 +9,11 @@
@@ -21,6 +21,7 @@
+

Choose a file and click "List Identifiers" to see identifiers you can translate.

tableHeaders(array($paginator->sort('id'),$paginator->sort('language_id'),$paginator->sort('filename_template'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); echo ''.$tableHeaders.''; ?> diff --git a/code/ryzom/tools/server/www/webtt/app/views/translation_files/view.ctp b/code/ryzom/tools/server/www/webtt/app/views/translation_files/view.ctp index 65cec5104..a77a28b04 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/translation_files/view.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/translation_files/view.ctp @@ -11,12 +11,13 @@
Languages
Identifiers
@@ -70,67 +71,20 @@ -
+ -
- - - - - - - - - - - - - - - - - > - - - - - - - - - - - - - -
- Html->link(__('View', true), array('controller' => 'identifiers', 'action' => 'view', $identifier['id'])); ?> -
- -
-
- +-->
diff --git a/code/ryzom/tools/server/www/webtt/app/views/translations/add.ctp b/code/ryzom/tools/server/www/webtt/app/views/translations/add.ctp index d42bdec3c..d23e0f5c6 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/translations/add.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/translations/add.ctp @@ -27,9 +27,12 @@ + + element('neighbours'); ?> - + +data['IdentifierColumn']); ?>
@@ -39,17 +42,36 @@
Form->create('Translation');?>
- + Form->hidden('identifier_id', array('default' => $identifier['Identifier']['id'])); - echo $this->Form->input('translation_text'); - // TODO: change user_id for authorized user - echo $this->Form->hidden('user_id', array('default' => 1)); + echo $form->hidden('Translation.identifier_id', array('default' => $identifier['Identifier']['id'])); + echo $form->hidden('Translation.user_id', array('value' => $this->Session->read('Auth.User.id'))); + if (!empty($identifier['IdentifierColumn'])) + { + $i=0; + foreach($identifierColumns as $key => $column) { + echo $form->hidden('ChildTranslation.'.$i.'.identifier_column_id', array('default' => $key)); + echo $form->input('ChildTranslation.'.$i.'.identifier_column_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$column, 'readonly' => 'readonly')); + echo $form->input('ChildTranslation.'.$i.'.translation_text', array('default' => $identifierColumnsDetails[$key]['reference_string'], 'rows' => 1, 'cols' => 80)); +// echo $form->input('ChildTranslation.'.$i.'.id'); + echo $form->hidden('ChildTranslation.'.$i.'.user_id', array('value' => $this->Session->read('Auth.User.id'))); + $i++; + } +// echo $this->Form->input('translation_text', array("rows" => 1, "cols" => 60)); + } + else + { + echo $this->Form->hidden('identifier_id', array('default' => $identifier['Identifier']['id'])); + echo $this->Form->input('translation_text', array('default' => $identifier['Identifier']['reference_string'], 'rows' => 8, 'cols' => 80)); + echo $this->Form->hidden('user_id', array('value' => $this->Session->read('Auth.User.id'))); + } + ?>
- Form->end(__('Submit', true));?> + Form->end(array('label' => __('Save and go to next identifier', true), 'name' => 'Next'));?> + Form->end(__('Save', true));?>
@@ -65,9 +87,9 @@
-
+
- Html->link($identifier['Language']['name'], array('controller' => 'languages', 'action' => 'view', $identifier['Language']['id'])); ?> + Html->link($identifier['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $identifier['TranslationFile']['id'])); ?>
diff --git a/code/ryzom/tools/server/www/webtt/app/views/translations/admin_edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/translations/admin_edit.ctp index baf23f0a6..c4ef20b1b 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/translations/admin_edit.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/translations/admin_edit.ctp @@ -17,7 +17,6 @@
Users
Votes
@@ -30,8 +29,9 @@
+
-

+

Form->create('Translation');?> @@ -39,13 +39,82 @@ Form->value('Translation.id')); ?> Form->input('id'); - echo $this->Form->input('identifier_id'); + echo $this->Form->input('identifier_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$this->Form->value('Identifier.identifier'), 'readonly' => 'readonly')); + echo $this->Form->hidden('identifier_id', array('default' => $this->Form->value('Translation.identifier_id'))); echo $this->Form->input('translation_text'); - echo $this->Form->input('user_id'); + echo $this->Form->hidden('user_id', array('value' => $this->Session->read('Auth.User.id'))); ?> - Form->end(__('Submit', true));?> +
+ Form->end(__('Submit', true));?> +
+
+
+

+
+
+ +
">
+
"> + + +
+ +
+
+
+ Html->link($identifier['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $identifier['TranslationFile']['id'])); ?> +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
+
+
+
+
diff --git a/code/ryzom/tools/server/www/webtt/app/views/translations/edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/translations/edit.ctp index 0484d295e..fc9233056 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/translations/edit.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/translations/edit.ctp @@ -27,6 +27,8 @@ + + element('neighbours'); ?> @@ -39,15 +41,38 @@ Form->value('Translation.id')); ?> Form->input('id'); - echo $this->Form->input('identifier_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$identifiers[$this->Form->value('Translation.identifier_id')], 'readonly' => 'readonly')); echo $this->Form->hidden('identifier_id', array('default' => $this->Form->value('Translation.identifier_id'))); - echo $this->Form->input('translation_text'); - // TODO: change user_id for authorized user - echo $this->Form->hidden('user_id', array('default' => 1)); + echo $this->Form->hidden('user_id', array('value' => $this->Session->read('Auth.User.id'))); + if (!empty($identifier['IdentifierColumn'])) + { +// var_dump($this->data); +// var_dump($translation); +// var_dump($identifierColumnTranslations); +// var_dump($identifierColumnsDetails2); +// var_dump($mapChildTranslationsColumns); + $i=$j=0; + foreach($identifierColumns as $key => $column) { + if (isset($mapChildTranslationsColumns[$key])) + $i = $mapChildTranslationsColumns[$key]; + else + $i = 'n'.$j++; + echo $form->hidden('ChildTranslation.'.$i.'.identifier_column_id', array('default' => $key)); + echo $form->input('ChildTranslation.'.$i.'.identifier_column_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$column, 'readonly' => 'readonly')); + echo $form->input('ChildTranslation.'.$i.'.translation_text', array('rows' => 1, 'cols' => 80)); + echo $form->input('ChildTranslation.'.$i.'.id'); + echo $form->hidden('ChildTranslation.'.$i.'.user_id', array('value' => $this->Session->read('Auth.User.id'))); + } + } + else + { + echo $this->Form->input('identifier_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$this->Form->value('Identifier.identifier'), 'readonly' => 'readonly')); + echo $this->Form->input('translation_text', array('rows' => 8, 'cols' => 80)); + } + ?>
- Form->end(__('Submit', true));?> + Form->end(__('Save', true));?>
@@ -64,9 +89,9 @@
-
+
- Html->link($identifier['Language']['name'], array('controller' => 'languages', 'action' => 'view', $identifier['Language']['id'])); ?> + Html->link($identifier['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $identifier['TranslationFile']['id'])); ?>
diff --git a/code/ryzom/tools/server/www/webtt/app/views/translations/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/translations/index.ctp index 7e44b94d2..d33f04bb7 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/translations/index.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/translations/index.ctp @@ -9,15 +9,15 @@
@@ -52,7 +52,7 @@ Html->link(__('View', true), array('action' => 'view', $translation['Translation']['id'])); ?> Html->link(__('Edit', true), array('action' => 'edit', $translation['Translation']['id'])); ?> Html->link(__('Delete', true), array('action' => 'delete', $translation['Translation']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['Translation']['id'])); ?> - | Html->link(__('Vote', true), array('controller' => 'votes', 'action' => 'vote', 'translation' => $translation['Translation']['id'])); ?> + | Html->link(__('Vote', true), array('controller' => 'votes', 'action' => 'vote', 'translation_id' => $translation['Translation']['id'])); ?> diff --git a/code/ryzom/tools/server/www/webtt/app/views/translations/view.ctp b/code/ryzom/tools/server/www/webtt/app/views/translations/view.ctp index a1b87c329..cc943d0f0 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/translations/view.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/translations/view.ctp @@ -8,28 +8,28 @@
Identifiers
Users
Votes
+ + element('neighbours'); ?>
@@ -81,6 +81,34 @@
+ + + + + + + + + + + + > + + + + + +
+ + + @@ -97,9 +125,9 @@
-
+
- Html->link($identifier['Language']['name'], array('controller' => 'languages', 'action' => 'view', $identifier['Language']['id'])); ?> + Html->link($identifier['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $identifier['TranslationFile']['id'])); ?>
@@ -150,7 +178,6 @@ -

@@ -195,7 +222,8 @@
    -
  • Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add'));?>
  • +
  • Html->link(sprintf(__('List related %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index', 'translation_id' => $translation['Translation']['id']));?>
  • +
  • Html->link(sprintf(__('New related %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'vote', 'translation_id' => $translation['Translation']['id']));?>

diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/admin_add.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/admin_add.ctp index 8a3121e33..3052a1c61 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/admin_add.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/users/admin_add.ctp @@ -1,25 +1,31 @@
@@ -34,10 +40,17 @@ Form->input('name'); + echo $this->Form->input('email'); + echo $this->Form->input('activated'); + echo $this->Form->input('username'); + echo $this->Form->input('password'); + echo $this->Form->input('role'); + echo $this->Form->input('confirm_hash'); ?> - Form->end(__('Submit', true));?> -
+
+Form->end(__('Submit', true));?> +
diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/admin_edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/admin_edit.ctp index ec9671ca6..66b84f137 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/admin_edit.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/users/admin_edit.ctp @@ -11,15 +11,27 @@
Translations
Votes
+ +
Comments
+ @@ -35,10 +47,16 @@ Form->input('id'); echo $this->Form->input('name'); + echo $this->Form->input('email'); + echo $this->Form->input('activated'); + echo $this->Form->input('username'); + echo $this->Form->input('role'); + echo $this->Form->input('confirm_hash'); ?> - Form->end(__('Submit', true));?> - +
+Form->end(__('Submit', true));?> +
diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/admin_index.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/admin_index.ctp index 43d7d4739..4f300270b 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/admin_index.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/users/admin_index.ctp @@ -4,18 +4,25 @@
-
+
+
+
+
@@ -23,7 +30,7 @@

- tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); +
tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('email'),$paginator->sort('activated'),$paginator->sort('username'),$paginator->sort('role'),$paginator->sort('confirm_hash'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); echo ''.$tableHeaders.''; ?> > + + + + +
diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/admin_view.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/admin_view.ctp index dd554f14a..780494378 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/admin_view.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/users/admin_view.ctp @@ -1,5 +1,6 @@
- @@ -35,35 +48,77 @@

- -
">
-
"> - + +
">
+
"> + +
+ +
-
- -
-
">
-
"> - +
">
+
"> + +
+ +
-
- -
-
">
-
"> - +
">
+
"> + +
+ +
-
- -
-
">
-
"> - +
">
+
"> + +
+ +
+ +
">
+
"> + +
+ +
+ +
">
+
"> + +
+ +
+ +
">
+
"> + +
+ +
+ +
">
+
"> + +
+ +
+ +
">
+
"> + +
+ +
+ +
">
+
"> + +
+ +
-
- -
@@ -74,22 +129,26 @@ diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/index.ctp index d8cc5607e..376183c78 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/index.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/users/index.ctp @@ -4,17 +4,24 @@
-
+
+
+
+
@@ -22,7 +29,7 @@

- tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); +
tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('email'),$paginator->sort('username'),$paginator->sort('role'),__('Actions', true),)); echo ''.$tableHeaders.''; ?> > - - + + + diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/login.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/login.ctp index bf04d682d..d5b4bdbc3 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/login.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/users/login.ctp @@ -1,3 +1,5 @@ +
+

Please login or Html->link(__('Register', true), array('admin' => false, 'controller' => 'users', 'action' => 'register')); ?>.

Session->flash('auth'); echo $this->Form->create('User', array('action' => 'login')); @@ -8,3 +10,4 @@ echo $this->Form->inputs(array( )); echo $this->Form->end('Login'); ?> +
\ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/register.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/register.ctp index cda035bce..01477d189 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/register.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/users/register.ctp @@ -1,3 +1,4 @@ +
Session->flash('email'); @@ -12,3 +13,4 @@ echo $this->Form->inputs(array( )); echo $this->Form->end('Register'); ?> +
\ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/view.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/view.ctp index 827058785..1014a2d71 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/view.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/users/view.ctp @@ -11,15 +11,27 @@
Translations
Votes
+ +
Comments
+ @@ -32,35 +44,42 @@

- -
">
-
"> - + +
">
+
"> + +
+ +
-
- -
-
">
-
"> - +
">
+
"> + +
+ +
-
- -
-
">
-
"> - +
">
+
"> + +
+ +
-
- -
-
">
-
"> - +
">
+
"> + +
+ +
+ +
">
+
"> + +
+ +
-
- -
@@ -71,22 +90,26 @@
Html->link(__('View', true), array('action' => 'view', $user['User']['id'])); ?>
- - - - - - + + + + + + + + - - > - - - - - - - - - + > + + + + + + + + + + +
- Html->link(__('View', true), array('controller' => 'translations', 'action' => 'view', $translation['id'])); ?> - Html->link(__('Edit', true), array('controller' => 'translations', 'action' => 'edit', $translation['id'])); ?> - Html->link(__('Delete', true), array('controller' => 'translations', 'action' => 'delete', $translation['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['id'])); ?> -
+ Html->link(__('View', true), array('controller' => 'translations', 'action' => 'view', $translation['id'])); ?> + Html->link(__('Edit', true), array('controller' => 'translations', 'action' => 'edit', $translation['id'])); ?> + Html->link(__('Delete', true), array('controller' => 'translations', 'action' => 'delete', $translation['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['id'])); ?> +
- +
    -
  • Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add'));?>
  • +
  • Html->link(sprintf(__('List related %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index', 'user_id' => $user['User']['id']));?>
  • +
  • Html->link(sprintf(__('New related %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'user_id' => $user['User']['id']));?>
- diff --git a/code/ryzom/tools/server/www/webtt/app/views/votes/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/votes/index.ctp index 1a76ec74b..4acc4185c 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/votes/index.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/votes/index.ctp @@ -5,14 +5,13 @@
diff --git a/code/ryzom/tools/server/www/webtt/app/webroot/css/labelWidth.css b/code/ryzom/tools/server/www/webtt/app/webroot/css/labelWidth.css index d7b3569a6..fb63b4d53 100644 --- a/code/ryzom/tools/server/www/webtt/app/webroot/css/labelWidth.css +++ b/code/ryzom/tools/server/www/webtt/app/webroot/css/labelWidth.css @@ -7,3 +7,6 @@ .fileIdentifiers div.dt, .fileIdentifiers label { width: 17em; } +.translationFiles div.dt, .translationFiles label { + width: 15em; +} diff --git a/code/ryzom/tools/server/www/webtt/app/webroot/css/layout.css b/code/ryzom/tools/server/www/webtt/app/webroot/css/layout.css index 259166d09..342fe53c8 100755 --- a/code/ryzom/tools/server/www/webtt/app/webroot/css/layout.css +++ b/code/ryzom/tools/server/www/webtt/app/webroot/css/layout.css @@ -194,7 +194,12 @@ blockquote cite { ul, ol { padding-top:0; } - + +p.help { + padding: 5px; + background: rgba(255,255,255, 0.2); + font-weight: bold; +} /* menus ----------------------------------------------- */ @@ -217,7 +222,6 @@ ul.menu li a:active { background:#ccc; } - /* submenus ----------------------------------------------- */ ul.menu ul { @@ -228,6 +232,15 @@ ul.menu ul li a { padding-left:30px; } +/* menu lists +----------------------------------------------- */ + ul.list { + margin-bottom: 0px; + border-top: 0px none; +} +ul.list li.current { + padding: 4px 14px; +} /* section menus ----------------------------------------------- */ diff --git a/code/ryzom/tools/server/www/webtt/app/webroot/js/jquery-fluid16.js b/code/ryzom/tools/server/www/webtt/app/webroot/js/jquery-fluid16.js index 08ab73d70..4da1f0d01 100755 --- a/code/ryzom/tools/server/www/webtt/app/webroot/js/jquery-fluid16.js +++ b/code/ryzom/tools/server/www/webtt/app/webroot/js/jquery-fluid16.js @@ -27,7 +27,7 @@ Ajax : function(){ Toggle : function(){ var default_hide = {"grid": true, "filter": true }; $.each( - ["admin-left-menu", "admin-actions", "help", "filter", "related-records", "grid", "paragraphs", "blockquote", "list-items", "section-menu", "tables", "forms", "login-forms", "search", "articles", "accordion"], + ["neighbour-actions", "admin-left-menu", "admin-actions", "help", "filter", "related-records", "grid", "paragraphs", "blockquote", "list-items", "section-menu", "tables", "forms", "login-forms", "search", "articles", "accordion"], function() { var el = $("#" + (this == 'accordon' ? 'accordion-block' : this) ); if (default_hide[this]) { diff --git a/code/ryzom/tools/server/www/webtt/docs/INSTALL b/code/ryzom/tools/server/www/webtt/docs/INSTALL new file mode 100644 index 000000000..3137f86e9 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/docs/INSTALL @@ -0,0 +1,31 @@ +1. Web-Based Translation Tool use ryzom translation pipeline, so you need to setup it first. + +2. Change path/to/translation to your translation pipeline path in app/config/database.php + +3. Add following VirtualHost config to your apache configuration. + + + DocumentRoot /path/to/webtt + + php_admin_value open_basedir none + php_flag short_open_tag on + php_value memory_limit 256M + php_flag output_buffering on + + ServerName webtt.your.domain + + +4. Change permissions to tmp directory. + +# chmod -R o+w webtt/app/tmp + +5. Create MySQL database with default user and WebTT tables. + +# mysql -uroot +CREATE DATABASE webtt2; +GRANT ALL ON webtt2.* TO webtt@localhost IDENTIFIED BY 'webtt77'; +# cat db/webtt2.db | mysql -uwebtt -pwebtt77 webtt2 + +6. Go to http://webtt.your.domain and register new user for user access. + +7. For administrator access, go to http://webtt.your.domain/admin and log in as admin/newpass diff --git a/code/ryzom/tools/server/www/webtt/docs/db/CakePHP_Associations b/code/ryzom/tools/server/www/webtt/docs/db/CakePHP_Associations new file mode 100644 index 000000000..addae59e6 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/docs/db/CakePHP_Associations @@ -0,0 +1,69 @@ +Name: Language +DB Table: `languages` +Associations: + Language hasMany TranslationFile + +Name: TranslationFile +DB Table: `translation_files` +Associations: + TranslationFile belongsTo Language + TranslationFile hasMany ImportedTranslationFile + TranslationFile hasMany Identifier + +Name: ImportedTranslationFile +DB Table: `imported_translation_files` +Associations: + TranslationFile belongsTo TranslationFile + TranslationFile hasMany FileIdentifier + +Name: Identifier +DB Table: `identifiers` +Associations: + Identifier belongsTo TranslationFile + Identifier hasMany Translation + Identifier hasMany Comment + Identifier hasMany FileIdentifier + Identifier hasMany IdentifierColumn + Identifier hasOne BestTranslation + +Name: IdentifierColumn +DB Table: `identifier_columns` +Associations: + IdentifierColumn belongsTo Identifier + IdentifierColumn hasMany Translation + +Name: FileIdentifier +DB Table: `file_identifiers` +Associations: + FileIdentifier belongsTo ImportedTranslationFile + FileIdentifier belongsTo Identifier + +Name: Translation +DB Table: `translations` +Associations: + Translation belongsTo Identifier + Translation belongsTo IdentifierColumn + Translation belongsTo User + Translation belongsTo ParentTranslation + Translation hasMany Vote + Translation hasMany ChildTranslation + +Name: User +DB Table: `users` +Associations: + User hasMany Translation + User hasMany Vote + User hasMany Comment + +Name: Vote +DB Table: `votes` +Associations: + Vote belongsTo Translation + Vote belongsTo User + +Name: Comment +DB Table: `comments` +Associations: + Comment belongsTo Identifier + Comment belongsTo User + diff --git a/code/ryzom/tools/server/www/webtt/docs/db/erd.png b/code/ryzom/tools/server/www/webtt/docs/db/erd.png new file mode 100644 index 000000000..d49b4e49c Binary files /dev/null and b/code/ryzom/tools/server/www/webtt/docs/db/erd.png differ diff --git a/code/ryzom/tools/server/www/webtt/docs/db/webtt2.db b/code/ryzom/tools/server/www/webtt/docs/db/webtt2.db new file mode 100644 index 000000000..41089a9d0 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/docs/db/webtt2.db @@ -0,0 +1,239 @@ +-- MySQL dump 10.13 Distrib 5.1.51, for pc-linux-gnu (x86_64) +-- +-- Host: localhost Database: webtt2 +-- ------------------------------------------------------ +-- Server version 5.1.51 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `comments` +-- + +DROP TABLE IF EXISTS `comments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `comments` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `translation_id` int(10) unsigned DEFAULT NULL, + `identifier_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `comment` text, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `identifier_id` (`identifier_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `file_identifiers` +-- + +DROP TABLE IF EXISTS `file_identifiers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `file_identifiers` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `imported_translation_file_id` int(10) unsigned DEFAULT NULL, + `command` varchar(50) DEFAULT NULL, + `translation_index` int(10) unsigned DEFAULT NULL, + `identifier_id` int(10) unsigned DEFAULT NULL, + `arguments` text, + `reference_string` text, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `imported_translation_file_id` (`imported_translation_file_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `identifier_columns` +-- + +DROP TABLE IF EXISTS `identifier_columns`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `identifier_columns` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `identifier_id` int(10) unsigned DEFAULT NULL, + `column_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `reference_string` text, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `identifier_id` (`identifier_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `identifiers` +-- + +DROP TABLE IF EXISTS `identifiers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `identifiers` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `language_id` int(10) unsigned DEFAULT NULL, + `translation_file_id` int(10) unsigned DEFAULT NULL, + `translation_index` int(10) unsigned DEFAULT NULL, + `identifier` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `arguments` text, + `reference_string` text, + `context_description` text, + `translated` tinyint(1) DEFAULT '0', + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `translation_file_id` (`translation_file_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `imported_translation_files` +-- + +DROP TABLE IF EXISTS `imported_translation_files`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `imported_translation_files` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `language_id` int(10) unsigned DEFAULT NULL, + `translation_file_id` int(10) unsigned DEFAULT NULL, + `filename` varchar(255) DEFAULT NULL, + `merged` tinyint(1) DEFAULT '0', + `file_last_modified_date` int(11) DEFAULT NULL, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `translation_file_id` (`translation_file_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `languages` +-- + +DROP TABLE IF EXISTS `languages`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `languages` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) DEFAULT NULL, + `code` varchar(10) DEFAULT NULL, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `translation_files` +-- + +DROP TABLE IF EXISTS `translation_files`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `translation_files` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `language_id` int(10) unsigned DEFAULT NULL, + `filename_template` varchar(255) DEFAULT NULL, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `language_id` (`language_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `translations` +-- + +DROP TABLE IF EXISTS `translations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `translations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `parent_id` int(10) unsigned DEFAULT NULL, + `identifier_id` int(10) unsigned DEFAULT NULL, + `identifier_column_id` int(10) unsigned DEFAULT NULL, + `translation_text` text, + `user_id` int(10) unsigned DEFAULT NULL, + `best` tinyint(1) DEFAULT NULL, + `translation_hash` varchar(32) DEFAULT NULL, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `best` (`best`), + KEY `identifier_column_id` (`identifier_column_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) DEFAULT NULL, + `email` varchar(200) DEFAULT NULL, + `activated` tinyint(1) DEFAULT NULL, + `username` varchar(40) DEFAULT NULL, + `password` varchar(100) DEFAULT NULL, + `role` varchar(20) DEFAULT NULL, + `confirm_hash` varchar(40) DEFAULT NULL, + `last_login` datetime DEFAULT NULL, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; + +INSERT INTO `users` VALUES (1,'Admin','',1,'admin','9ff60bfc5939c7863518e202cba4dff81da316be','admin',NULL,NULL,NULL,NULL); + +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `votes` +-- + +DROP TABLE IF EXISTS `votes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `votes` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `translation_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `created` datetime DEFAULT NULL, + `modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;