Changeset 29893 for websites/trajoin
- Timestamp:
- 02/11/09 09:16:50 (4 years ago)
- Location:
- websites/trajoin/trunk
- Files:
-
- 5 modified
-
apps/frontend/config/module.yml (modified) (1 diff)
-
apps/frontend/modules/translation/actions/actions.class.php (modified) (1 diff)
-
apps/frontend/modules/translation/templates/showTranslatedSuccess.php (modified) (1 diff)
-
config/schema.yml (modified) (2 diffs)
-
lib/model/HistoryPeer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
websites/trajoin/trunk/apps/frontend/config/module.yml
r29849 r29893 5 5 1.2/jobeet/en: jobbet directory 6 6 1.2/cookbook/en: test 7 1.2/forms_book/en: form 7 8 jobeet: Learn symfony step by step 24 days, 1 hour a day 8 9 1.2/book: The Definitive Guide to symtony -
websites/trajoin/trunk/apps/frontend/modules/translation/actions/actions.class.php
r29888 r29893 77 77 $newTranslation = $this->form->save(); 78 78 HistoryPeer::save($this->form->getObject(), $request->getParameter('translation[note]'), date('Y-m-d H:i:s')); 79 HistoryPeer::commit2repo($this->Parser->getFilePath(), $request->getParameter('translation[note]')); 79 80 // svn commit if on production server 80 if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {81 $Filesystem = new sfFilesystem();82 $svnPath = "../data/contents/markdown/1.2/";83 $this->logMessage($Filesystem->sh(sprintf('../symfony trajoin:markdown %s', $this->Parser->getFilePath())));84 $cmd= sprintf('svn status --config-dir /home/svn/.subversion %s* |grep ^? |cut -d \' \' -f 7 | xargs --no-run-if-empty svn add --config-dir /home/svn/.subversion ', $svnPath);85 $this->logMessage($Filesystem->sh($cmd));86 $cmd= sprintf('svn commit --config-dir /home/svn/.subversion -m "%s" %s --username trajoin', escapeshellcmd($request->getParameter('translation[note]')), $svnPath);87 $this->logMessage($Filesystem->sh($cmd));88 }81 // if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) { 82 // $Filesystem = new sfFilesystem(); 83 // $svnPath = "../data/contents/markdown/1.2/"; 84 // $this->logMessage($Filesystem->sh(sprintf('../symfony trajoin:markdown %s', $this->Parser->getFilePath()))); 85 // $cmd= sprintf('svn status --config-dir /home/svn/.subversion %s* |grep ^? |cut -d \' \' -f 7 | xargs --no-run-if-empty svn add --config-dir /home/svn/.subversion ', $svnPath); 86 // $this->logMessage($Filesystem->sh($cmd)); 87 // $cmd= sprintf('svn commit --config-dir /home/svn/.subversion -m "%s" %s --username trajoin', escapeshellcmd($request->getParameter('translation[note]')), $svnPath); 88 // $this->logMessage($Filesystem->sh($cmd)); 89 //} 89 90 } else { 90 91 $this->form->updateObject($this->form->getValues()); -
websites/trajoin/trunk/apps/frontend/modules/translation/templates/showTranslatedSuccess.php
r29840 r29893 7 7 <a href="<?php echo url_for('@original') . "/" . $filePath ?>"><?php echo basename($filePath) ?></a> 8 8 </p> 9 10 9 <?php foreach($Parser->getChunks(ESC_RAW) as $id => $chunk): ?> 11 10 <?php if (trim($chunk) == "") continue ?> -
websites/trajoin/trunk/config/schema.yml
r29840 r29893 7 7 id: { type: INTEGER, primaryKey: true, required: true, autoincrement: true } 8 8 file_path: { type: VARCHAR, size: '255', required: true, index: true } 9 original: { type: LONGVARCHAR, required: false }9 original: { type: VARBINARY, required: false } 10 10 translation_i18n: 11 11 _attributes: { phpName: TranslationI18n } … … 29 29 translation_id: { type: INTEGER, required: true, foreignTable: translation, foreignReference: id } 30 30 culture: { type: VARCHAR, size: '7', required: true } 31 original: { type: LONGVARCHAR, required: false }31 original: { type: VARBINARY, required: false } 32 32 translated: { type: LONGVARCHAR, required: true } 33 33 note: { type: LONGVARCHAR, required: false } -
websites/trajoin/trunk/lib/model/HistoryPeer.php
r29840 r29893 113 113 $translation->getCurrentTranslationI18n()->setUserId($history->getUserId()); 114 114 $translation->save(); 115 // commit to repo 116 self::commit2repo($translation->getFilePath(), $history->getNote()); 115 117 // clear histories by same user and same chunk 116 118 $sameHistories = self::retrieveByTranslationId($history->getTranslationId(), $history->getCulture()); … … 126 128 } 127 129 } 130 static public function commit2repo($filePath, $message="") 131 { 132 // svn commit if on production server 133 if (in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) return; 134 $Filesystem = new sfFilesystem(); 135 $svnPath = "../data/contents/markdown/1.2/"; 136 $cmd= sprintf('svn update --config-dir /home/svn/.subversion %s', $svnPath); 137 //$cmd= sprintf('svn update %s', $svnPath); 138 self::logMessage($Filesystem->sh($cmd)); 139 self::logMessage($Filesystem->sh(sprintf('../symfony trajoin:markdown %s', $filePath))); 140 $cmd= sprintf('svn status --config-dir /home/svn/.subversion %s* |grep ^? |cut -d \' \' -f 7 | xargs --no-run-if-empty svn add --config-dir /home/svn/.subversion ', $svnPath); 141 //$cmd= sprintf('svn status %s* |grep ^? |cut -d \' \' -f 7 | xargs svn add ', $svnPath); 142 self::logMessage($Filesystem->sh($cmd)); 143 $cmd= sprintf('svn commit --config-dir /home/svn/.subversion -m "%s" %s --username trajoin', escapeshellcmd($message), $svnPath); 144 //$cmd= sprintf('svn commit -m "%s" %s --username trajoin', escapeshellcmd($message), $svnPath); 145 self::logMessage($Filesystem->sh($cmd)); 146 } 147 static private function logMessage($message) 148 { 149 if (sfConfig::get('sf_logging_enabled')) { 150 sfContext::getInstance()->getLogger()->info($message); 151 } 152 } 128 153 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)