cvs: doc-editor /install doc-editor.sql /js main.js /php ExtJsController.php class.php /themes style.css

From: Date: Sat, 25 Apr 2009 08:38:45 +0000
Subject: cvs: doc-editor /install doc-editor.sql /js main.js /php ExtJsController.php class.php /themes style.css
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3867@lists.php.net to get a copy of this message
yannick Sat Apr 25 08:38:45 2009 UTC Modified files: /doc-editor/install doc-editor.sql /doc-editor/js main.js /doc-editor/php class.php ExtJsController.php /doc-editor/themes style.css Log: - More work on NotInEN module

http://cvs.php.net/viewvc.cgi/doc-editor/install/doc-editor.sql?r1=1.5&r2=1.6&diff_format=u Index: doc-editor/install/doc-editor.sql diff -u doc-editor/install/doc-editor.sql:1.5 doc-editor/install/doc-editor.sql:1.6 --- doc-editor/install/doc-editor.sql:1.5 Thu Apr 23 20:03:40 2009 +++ doc-editor/install/doc-editor.sql Sat Apr 25 08:38:44 2009 @@ -90,6 +90,7 @@ `maintainer` varchar(255) NOT NULL, `modified_by` varchar(50) NOT NULL, `date` datetime NOT NULL, + `type` enum('new','delete','update') NOT NULL, KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; http://cvs.php.net/viewvc.cgi/doc-editor/js/main.js?r1=1.51&r2=1.52&diff_format=u Index: doc-editor/js/main.js diff -u doc-editor/js/main.js:1.51 doc-editor/js/main.js:1.52 --- doc-editor/js/main.js:1.51 Wed Apr 22 21:32:39 2009 +++ doc-editor/js/main.js Sat Apr 25 08:38:45 2009 @@ -29,6 +29,7 @@ storeFilesError: '', // storeFilesNeedUpdate: '', storeFilesNeedReviewed: '', + storeNotInEn: '', storePendingCommit: '', storePendingPatch: '', @@ -42,7 +43,7 @@ userLang: '', appName: 'PhpDocumentation Online Editor', appVer: '0.2', - uiRevision: '$Revision: 1.51 $', + uiRevision: '$Revision: 1.52 $', userConf: { 'conf_needupdate_diff': 'using-exec', @@ -409,8 +410,45 @@ } } }); - - + + // Store : Not In En tree + this.storeNotInEn = new Ext.data.GroupingStore({ + autoLoad: true, + proxy: new Ext.data.HttpProxy({ + url: './php/controller.php' + }), + baseParams: { + task: 'getFilesNotInEn' + }, + reader: new Ext.data.JsonReader({ + root: 'Items', + totalProperty: 'nbItems', + id: 'id' + }, [{ + name: 'id', + mapping: 'id' + }, { + name: 'path', + mapping: 'path' + }, { + name: 'name', + mapping: 'name' + }]), + sortInfo: { + field: 'path', + direction: "ASC" + }, + groupField: 'path', + listeners: { + datachanged: function(ds){ + Ext.getDom('acc-notInEn-nb').innerHTML = ds.getCount(); + }, + add: function(ds){ + Ext.getDom('acc-notInEn-nb').innerHTML = ds.getCount(); + } + } + }); + // Store : this.storePendingCommit = new Ext.data.GroupingStore({ autoLoad: true, @@ -441,6 +479,9 @@ mapping: 'date', type: 'date', dateFormat: 'Y-m-d H:i:s' + }, { + name: 'type', + mapping: 'type' }]), sortInfo: { field: 'path', @@ -1100,7 +1141,7 @@ if (o.success) { // Add this files into storePendingCommit - this.addToPendingCommit(FilePath, FileName); + this.addToPendingCommit(FilePath, FileName, 'update'); // Remove this patch from the PendingPatchStore this.storePendingPatch.remove(this.storePendingPatch.getAt(rowIndex)); @@ -1186,7 +1227,7 @@ } // Add this files into storePendingCommit - this.addToPendingCommit("en" + FilePath, FileName); + this.addToPendingCommit("en" + FilePath, FileName, 'update'); // Remove wait msg msg.hide(); @@ -1376,7 +1417,7 @@ } // Add this files into storePendingCommit - this.addToPendingCommit(this.userLang + FilePath, FileName); + this.addToPendingCommit(this.userLang + FilePath, FileName, 'update'); // Remove wait msg msg.hide(); @@ -1485,7 +1526,7 @@ } // Add this files into storePendingCommit - this.addToPendingCommit(this.userLang + FilePath, FileName); + this.addToPendingCommit(this.userLang + FilePath, FileName, 'update'); } else { this.winForbidden(); @@ -1585,7 +1626,7 @@ this.storePendingPatch.insert(0, r); }, //addToPendingPatch - addToPendingCommit: function(FilePath, FileName){ + addToPendingCommit: function(FilePath, FileName, type){ var alReady, dt, r1; @@ -1608,7 +1649,8 @@ path: FilePath, name: FileName, by: this.userLogin, - date: dt + date: dt, + type: type }); this.storePendingCommit.insert(0, r1); } @@ -3168,7 +3210,7 @@ }, //sendEmail drawInterface: function(){ - var gridFilesError, gridFilesNeedUpdate, gridPendingPatch, gridPendingCommit, gridFilesNeedReviewed, gridSummary, gridTranslators, gridMailing, gridBugs, graphPanel, mainMenu, MainWindow, mainContent; + var gridFilesError, gridFilesNeedUpdate, gridPendingPatch, gridPendingCommit, gridFilesNeedReviewed, gridSummary, gridTranslators, gridMailing, gridNotInEn, gridBugs, graphPanel, mainMenu, MainWindow, mainContent; // We keel alive our session by sending a ping every minute this.TaskPing = new Ext.util.DelayedTask(function(){ @@ -3205,6 +3247,7 @@ }, this); this.TaskPing.delay(30000); // start after 1 minute. + // Grid : Files in Error gridFilesError = new Ext.grid.GridPanel({ store: this.storeFilesError, @@ -5135,7 +5178,50 @@ } } // listeners }); - + + // Grid : Not In En tree + gridNotInEn = new Ext.grid.GridPanel({ + store: this.storeNotInEn, + loadMask: true, + columns: [{ + id: 'name', + header: _('Files'), + sortable: true, + dataIndex: 'name' + }, { + header: _('Path'), + dataIndex: 'path', + 'hidden': true + }], + view: new Ext.grid.GroupingView({ + forceFit: true, + groupTextTpl: '{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "'+_('Files')+'" : "'+_('File')+'"]})', + emptyText: '<div style="text-align: center;">'+_('No Files')+'</div>' + }), + autoExpandColumn: 'name', + bodyBorder: false, + listeners: { + scope: this, + rowcontextmenu: function(grid, rowIndex, e){ + + grid.getSelectionModel().selectRow(rowIndex); + + var menu = new Ext.menu.Menu({ + items: [{ + text: _('Remove this file'), + iconCls: 'iconDelete', + scope: this, + handler: function(){ + + } + }] + }); + menu.showAt(e.getXY()); + + } + } + }); + // Grid : Pending for commit gridPendingCommit = new Ext.grid.GridPanel({ store: this.storePendingCommit, @@ -5165,7 +5251,18 @@ view: new Ext.grid.GroupingView({ forceFit: true, groupTextTpl: '{[values.rs[0].data["path"]]} ({[values.rs.length]} {[values.rs.length > 1 ? "'+_('Files')+'" : "'+_('File')+'"]})', - emptyText: '<div style="text-align: center;">'+_('No pending for Commit')+'</div>' + emptyText: '<div style="text-align: center;">'+_('No pending for Commit')+'</div>', + getRowClass: function(record, numIndex, rowParams, store){ + if ( record.data.type === 'update' ) { + return 'file-needcommit-update'; + } + if ( record.data.type === 'delete' ) { + return 'file-needcommit-delete'; + } + if ( record.data.type === 'new' ) { + return 'file-needcommit-new'; + } + } }), autoExpandColumn: 'name', bodyBorder: false, @@ -6951,7 +7048,7 @@ node.getUI().addClass('modified'); // Add this files into storePendingCommit - this.addToPendingCommit(FilePath, FileName); + this.addToPendingCommit(FilePath, FileName, 'update'); // Remove wait msg msg.hide(); @@ -7217,6 +7314,13 @@ } } }, { + title: _('Not in EN tree')+' - <em id="acc-notInEn-nb">0</em>', + id: 'acc-notInEn', + layout: 'fit', + iconCls: 'NotInEn', + items: [gridNotInEn], + collapsed: true + }, { title: _('All files'), id: 'acc-all-files', layout: 'fit', http://cvs.php.net/viewvc.cgi/doc-editor/php/class.php?r1=1.42&r2=1.43&diff_format=u Index: doc-editor/php/class.php diff -u doc-editor/php/class.php:1.42 doc-editor/php/class.php:1.43 --- doc-editor/php/class.php:1.42 Fri Apr 24 13:49:32 2009 +++ doc-editor/php/class.php Sat Apr 25 08:38:45 2009 @@ -101,6 +101,7 @@ || $file == 'README' || $file == 'DO_NOT_TRANSLATE' || $file == 'rsusi.txt' + || $file == 'translation.xml' || $file == 'missing-ids.xml' || $file == 'license.xml' || $file == 'versions.xml' @@ -641,10 +642,10 @@ function checkOldFiles() { - while (list(, $lang) = each($this->availableLanguage)) { + reset($this->availableLanguage); + while (list(, $lang) = each($this->availableLanguage)) { $this->doCheckOldFiles('', $lang); - } } @@ -678,7 +679,7 @@ if (!@is_file($path_en)) { $size = intval(filesize($path) / 1024); - + $s = sprintf('INSERT INTO `files` (`lang`, `path`, `name`, `status`) VALUES (%s, %s, %s, %s)', "'".$lang."'", "'$dir/'", @@ -905,6 +906,26 @@ } /** + * Get all witch are not in EN tree. + * @return An associated array containing all informations about files witch are not in EN tree + */ + function getFilesNotInEn() { + + $s = sprintf('SELECT `id`, `path`, `name` FROM `files` WHERE `lang`="%s" AND `status`=\'NotInEN\'', $this->cvsLang); + + $r = $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); + $nb = $r->num_rows; + + $node = array(); + + while ($row = $r->fetch_assoc()) { + $node[] = $row; + } + + return array('nb' => $nb, 'node' => $node); + } + + /** * Get all pending patch. * @return An associated array containing all informations about pending patch. */ @@ -943,7 +964,8 @@ "path" => $a->lang.$a->path, "name" => $a->name, "by" => $a->modified_by, - "date" => $a->date + "date" => $a->date, + "type" => $a->type ); } @@ -1456,9 +1478,10 @@ * @param $en_revision The EN revision of this file. * @param $reviewed The stats of the reviewed tag. * @param $maintainer The maintainer. + * @param $type The type of commit. Can be 'new' for new file, 'update' for an uptaded file or 'delete' for a file marked as delete * @return Nothing. */ - function registerAsPendingCommit($lang, $FilePath, $FileName, $revision, $en_revision, $reviewed, $maintainer) { + function registerAsPendingCommit($lang, $FilePath, $FileName, $revision, $en_revision, $reviewed, $maintainer, $type='update') { $s = sprintf('SELECT id FROM `pendingCommit` WHERE `lang`="%s" AND `path`="%s" AND `name`="%s"', $lang, $FilePath, $FileName); $r = $this->db->query($s); @@ -1468,7 +1491,7 @@ // We insert or update the pendingCommit table if ($nb == 0 ) { - $s = sprintf('INSERT into `pendingCommit` (`lang`, `path`, `name`, `revision`, `en_revision`, `reviewed`, `maintainer`, `modified_by`, `date`) VALUES ("%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", now())', $lang, $FilePath, $FileName, $revision, $en_revision, $reviewed, $maintainer, $this->cvsLogin); + $s = sprintf('INSERT into `pendingCommit` (`lang`, `path`, `name`, `revision`, `en_revision`, `reviewed`, `maintainer`, `modified_by`, `date`, `type`) VALUES ("%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", now(), "%s")', $lang, $FilePath, $FileName, $revision, $en_revision, $reviewed, $maintainer, $this->cvsLogin, $type); $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); $fileID = $this->db->insert_id; } else { http://cvs.php.net/viewvc.cgi/doc-editor/php/ExtJsController.php?r1=1.23&r2=1.24&diff_format=u Index: doc-editor/php/ExtJsController.php diff -u doc-editor/php/ExtJsController.php:1.23 doc-editor/php/ExtJsController.php:1.24 --- doc-editor/php/ExtJsController.php:1.23 Thu Apr 23 20:03:40 2009 +++ doc-editor/php/ExtJsController.php Sat Apr 25 08:38:45 2009 @@ -222,6 +222,12 @@ return $this->getResponse(array('nbItems' => $r['nb'], 'Items' => $r['node'])); } + //NEW + public function getFilesNotInEn() { + $this->phpDoc->isLogged(); + $r = $this->phpDoc->getFilesNotInEn(); + return $this->getResponse(array('nbItems' => $r['nb'], 'Items' => $r['node'])); + } // NEW public function getFilesNeedReviewed() { $this->phpDoc->isLogged(); @@ -418,7 +424,7 @@ if ($type == 'file') { $this->phpDoc->saveFile($filePath.$fileName, $fileContent, $fileLang, 'file'); - $this->phpDoc->registerAsPendingCommit($fileLang, $filePath, $fileName, $info['rev'], $info['en-rev'], $info['reviewed'], $info['maintainer']); + $this->phpDoc->registerAsPendingCommit($fileLang, $filePath, $fileName, $info['rev'], $info['en-rev'], $info['reviewed'], $info['maintainer'], 'update'); return $this->getResponse(array( 'success' => true, 'en_revision' => $info['rev'], http://cvs.php.net/viewvc.cgi/doc-editor/themes/style.css?r1=1.9&r2=1.10&diff_format=u Index: doc-editor/themes/style.css diff -u doc-editor/themes/style.css:1.9 doc-editor/themes/style.css:1.10 --- doc-editor/themes/style.css:1.9 Thu Apr 16 17:41:14 2009 +++ doc-editor/themes/style.css Sat Apr 25 08:38:45 2009 @@ -158,6 +158,10 @@ height: 14px; } +.NotInEn { + background-image: url(../themes/img/delete.png) !important; +} + /* X-BROWSER-WARNING: this is not being honored by Safari */ .ux-icon-combo-input { padding-left: 25px; } .x-form-field-wrap .ux-icon-combo-icon { @@ -445,4 +449,18 @@ } .check_doc_cell { background-color: #DEDEDE; text-align: right; +} + +.file-needcommit-update { + background-image: url(../themes/img/arrow_refresh.png) !important; + background-repeat: no-repeat !important; + +} +.file-needcommit-delete { + background-image: url(../themes/img/delete.png) !important; + background-repeat: no-repeat !important; +} +.file-needcommit-new { + background-image: url(../themes/img/lightbulb_add.png) !important; + background-repeat: no-repeat !important; } \ No newline at end of file
« previous php.doc.cvs (#3867) next »