Changeset 1688
- Timestamp:
- 03/09/10 09:21:05 (5 months ago)
- Location:
- trunk
- Files:
-
- 5 added
- 27 modified
-
plugins/ullCorePlugin/data/fixtures/ullCoreFixtures.yml (modified) (1 diff)
-
plugins/ullCorePlugin/lib/form/widget/ullMetaWidgetForeignKey.class.php (modified) (2 diffs)
-
plugins/ullCorePlugin/lib/migrations/1268058102_ull_flow_project_reporting.php (added)
-
plugins/ullCorePlugin/lib/ullTestBrowser.class.php (modified) (1 diff)
-
plugins/ullFlowPlugin/config/doctrine/ullFlowSchema.yml (modified) (5 diffs)
-
plugins/ullFlowPlugin/data/fixtures/ullFlowFixtures.yml (modified) (7 diffs)
-
plugins/ullFlowPlugin/i18n/ullFlowMessages.de.xml (modified) (2 diffs)
-
plugins/ullFlowPlugin/lib/UllFlowDocRecordFilter.class.php (modified) (1 diff)
-
plugins/ullFlowPlugin/lib/form/ullFlowForm.php (modified) (1 diff)
-
plugins/ullFlowPlugin/lib/generator/columnConfigCollection/UllFlowAppColumnConfigCollection.class.php (modified) (1 diff)
-
plugins/ullFlowPlugin/lib/generator/columnConfigCollection/UllFlowDocColumnConfigCollection.class.php (modified) (1 diff)
-
plugins/ullFlowPlugin/lib/model/doctrine/PluginUllFlowDoc.class.php (modified) (6 diffs)
-
plugins/ullFlowPlugin/lib/model/doctrine/PluginUllFlowMemory.class.php (modified) (1 diff)
-
plugins/ullFlowPlugin/lib/ullFlowGenerator.class.php (modified) (1 diff)
-
plugins/ullFlowPlugin/modules/ullFlow/lib/BaseUllFlowActions.class.php (modified) (2 diffs)
-
plugins/ullFlowPlugin/modules/ullFlow/templates/_ullFlowHeader.php (modified) (1 diff)
-
plugins/ullFlowPlugin/modules/ullFlow/templates/editSuccess.php (modified) (1 diff)
-
plugins/ullTimePlugin/config/doctrine/ullTimeSchema.yml (modified) (2 diffs)
-
plugins/ullTimePlugin/i18n/ullTimeMessages.de.xml (modified) (1 diff)
-
plugins/ullTimePlugin/lib/generator/columnConfigCollection/base/BaseUllProjectColumnConfigCollection.class.php (modified) (1 diff)
-
plugins/ullTimePlugin/lib/generator/columnConfigCollection/base/BaseUllProjectReportingColumnConfigCollection.class.php (modified) (1 diff)
-
plugins/ullTimePlugin/lib/model/doctrine/PluginUllProjectReporting.class.php (modified) (1 diff)
-
plugins/ullTimePlugin/modules/ullTime/templates/editProjectSuccess.php (modified) (1 diff)
-
test/functional/frontend/ullFlowPlugin/ullFlowCrudTest.php (modified) (3 diffs)
-
test/functional/frontend/ullFlowPlugin/ullFlowWorkflowTest.php (modified) (1 diff)
-
test/functional/frontend/ullFlowPlugin/ullTimeFixtures.yml (added)
-
test/unit/ullFlowPlugin/UllFlowDocTest.php (modified) (8 diffs)
-
test/unit/ullFlowPlugin/UllFlowMemoryTest.php (added)
-
test/unit/ullFlowPlugin/ullFlowGeneratorTest.php (modified) (4 diffs)
-
test/unit/ullFlowPlugin/ullTimeFixtures.yml (added)
-
test/unit/ullTimePlugin/UllProjectReportingTest.php (modified) (3 diffs)
-
test/unit/ullTimePlugin/ullFlowFixtures.yml (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/ullCorePlugin/data/fixtures/ullCoreFixtures.yml
r1679 r1688 280 280 class: ullMetaWidgetPhoneNumber 281 281 label: PhoneNumber 282 namespace: ullCore 282 namespace: ullCore 283 ull_project: 284 class: ullMetaWidgetUllProject 285 label: UllProject 286 namespace: ullCore 283 287 284 288 UllSelect: -
trunk/plugins/ullCorePlugin/lib/form/widget/ullMetaWidgetForeignKey.class.php
r1136 r1688 11 11 protected function configure() 12 12 { 13 $relation = $this->columnConfig->getRelation();14 13 if (!$this->columnConfig->getWidgetOption('model')) 15 14 { 15 $relation = $this->columnConfig->getRelation(); 16 16 $this->columnConfig->setWidgetOption('model', $relation['model']); 17 } 17 } 18 18 } 19 19 … … 47 47 * Parse options 48 48 * 49 * Only for write mode 50 * 49 51 * @return unknown_type 50 52 */ 51 53 protected function parseOptions() 52 54 { 53 $validatorOptions = $this->columnConfig->getValidatorOptions(); 54 $relation = $this->columnConfig->getRelation(); 55 $this->columnConfig->setValidatorOption('model', $relation['model']); 55 if ($this->columnConfig->getWidgetOption('model')) 56 { 57 $this->columnConfig->setValidatorOption('model', $this->columnConfig->getWidgetOption('model')); 58 } 59 else 60 { 61 $relation = $this->columnConfig->getRelation(); 62 $this->columnConfig->setValidatorOption('model', $relation['model']); 63 } 64 56 65 57 66 // the dropdown field can't be mandatory in case of allowCreate -
trunk/plugins/ullCorePlugin/lib/ullTestBrowser.class.php
r1674 r1688 209 209 'attachments', 210 210 'wiki_links', 211 'project', 211 212 'tags', 212 213 ), -
trunk/plugins/ullFlowPlugin/config/doctrine/ullFlowSchema.yml
r1469 r1688 20 20 is_public: 21 21 type: boolean 22 enter_effort: 23 type: boolean 22 24 relations: 23 25 UllPermission: … … 70 72 #this is used to set the record always dirty, even when only virtual columns are changed. 71 73 dirty: 74 type: integer 75 ull_project_id: 72 76 type: integer 73 77 relations: … … 89 93 foreignType: one 90 94 type: many 95 UllProject: 91 96 92 97 UllFlowColumnConfig: … … 128 133 type: boolean 129 134 default: false 135 is_project: 136 type: boolean 137 default: false 130 138 default_value: 131 139 type: string(255) … … 188 196 creator_ull_entity_id: 189 197 type: integer 190 notnull: true 198 notnull: true 199 durations_seconds: 200 type: integer 191 201 relations: 192 202 UllFlowDoc: -
trunk/plugins/ullFlowPlugin/data/fixtures/ullFlowFixtures.yml
r1663 r1688 77 77 list_columns: id,subject,priority,assigned_to_ull_entity_id,created_at 78 78 #is_public: true 79 enter_effort: true 79 80 ull_flow_app_todo: 80 81 Translation: … … 106 107 created_at: '2001-01-01 01:01:01' 107 108 duplicate_tags_for_search: ull_flow_tag1, ull_flow_tag2 109 ull_project_id: 1 108 110 namespace: test 109 111 ull_flow_doc_trouble_ticket2: … … 113 115 UllEntity: helpdesk_group 114 116 UllFlowStep: ull_flow_step_doc_trouble_ticket_dispatcher 117 ull_project_id: 1 115 118 namespace: test 116 119 ull_flow_doc_todo1: … … 175 178 UllColumnType: date 176 179 namespace: test 180 177 181 ull_flow_column_config_trouble_ticket_email: 178 182 Translation: … … 223 227 UllColumnType: wiki_link 224 228 namespace: test 229 230 ull_flow_column_config_trouble_ticket_project: 231 Translation: 232 en: 233 label: Project 234 de: 235 label: Projekt 236 UllFlowApp: ull_flow_app_trouble_ticket 237 slug: my_project 238 is_mandatory: true 239 is_project: true 240 sequence: 6500 241 UllColumnType: ull_project 242 options: add_empty=true model=UllProject 243 namespace: test 244 225 245 ull_flow_column_config_trouble_ticket_column_tags: 226 246 Translation: … … 310 330 UllFlowColumnConfig: ull_flow_column_config_trouble_ticket_wiki_link 311 331 value: 1 312 namespace: test 332 namespace: test 333 ull_flow_value_doc_trouble_ticket1_project: 334 UllFlowDoc: ull_flow_doc_trouble_ticket1 335 UllFlowColumnConfig: ull_flow_column_config_trouble_ticket_project 336 value: 1 337 namespace: test 313 338 ull_flow_value_doc_trouble_ticket1_column_tags: 314 339 UllFlowDoc: ull_flow_doc_trouble_ticket1 … … 332 357 value: bender@ull.at 333 358 namespace: test 359 ull_flow_value_doc_trouble_ticket2_project: 360 UllFlowDoc: ull_flow_doc_trouble_ticket2 361 UllFlowColumnConfig: ull_flow_column_config_trouble_ticket_project 362 value: 1 363 namespace: test 334 364 335 365 ull_flow_value_doc_todo1_subject: -
trunk/plugins/ullFlowPlugin/i18n/ullFlowMessages.de.xml
r1595 r1688 99 99 <target>Ist Tagging-Spalte?</target> 100 100 </trans-unit> 101 102 <trans-unit id="20"> 103 <source>Effort</source> 104 <target>Aufwand</target> 105 </trans-unit> 106 107 <trans-unit id="21"> 108 <source>Hours : minutes</source> 109 <target>Stunden : Minuten</target> 110 </trans-unit> 111 112 <trans-unit id="22"> 113 <source>Enter effort</source> 114 <target>AufwÀnde erfassen</target> 115 </trans-unit> 116 101 117 102 118 <!-- Queries --> … … 125 141 <target>ZuweisungsÃŒbersicht</target> 126 142 </trans-unit> 143 144 127 145 128 146 <!-- table config --> -
trunk/plugins/ullFlowPlugin/lib/UllFlowDocRecordFilter.class.php
r1460 r1688 59 59 $record->priority = $value; 60 60 } 61 if ($cc->is_project) 62 { 63 $record->ull_project_id = $value; 64 } 61 65 if ($cc->is_tagging) 62 66 { -
trunk/plugins/ullFlowPlugin/lib/form/ullFlowForm.php
r1631 r1688 25 25 $this->getWidgetSchema()->offsetSet('memory_comment', new sfWidgetFormInput(array(), array('size' => 50))); 26 26 $this->getValidatorSchema()->offsetSet('memory_comment', new sfValidatorString(array('required' => false))); 27 28 $this->getWidgetSchema()->offsetSet('duration_seconds', new ullWidgetTimeDurationWrite()); 29 $this->getValidatorSchema()->offsetSet('duration_seconds', new ullValidatorTimeDuration(array('required' => false))); 27 30 } 28 31 } -
trunk/plugins/ullFlowPlugin/lib/generator/columnConfigCollection/UllFlowAppColumnConfigCollection.class.php
r1111 r1688 11 11 $this['doc_label']->setLabel(__('Label of a document', null, 'ullFlowMessages')); 12 12 $this['list_columns']->setLabel(__('List of result list columns', null, 'ullFlowMessages')); 13 $this['enter_effort']->setLabel(__('Enter effort', null, 'ullFlowMessages')); 13 14 } 14 15 } -
trunk/plugins/ullFlowPlugin/lib/generator/columnConfigCollection/UllFlowDocColumnConfigCollection.class.php
r1469 r1688 129 129 $this[$columnName]->setDefaultValue($column->default_value); 130 130 } 131 132 // if ($column->UllColumnType->class == 'UllProject') 133 // { 134 // $this[$columnName]->setRelation 135 // } 131 136 } 132 137 } -
trunk/plugins/ullFlowPlugin/lib/model/doctrine/PluginUllFlowDoc.class.php
r1628 r1688 9 9 protected 10 10 $memoryComment = '', 11 $memoryDuration = 0, 11 12 $memoryAction = null 12 13 ; 14 15 16 /** 17 * String representation 18 * 19 * @return string 20 */ 21 public function __toString() 22 { 23 return $this->UllFlowApp->doc_label . ' "'. $this->subject . '"'; 24 } 25 13 26 14 27 // TODO: give UllFlowApp in the constructor to force check if … … 87 100 return $this->memoryComment; 88 101 } 89 102 90 103 /** 91 104 * Sets a custom UllFlowMemory action. … … 242 255 } 243 256 257 244 258 /** 245 259 * Get the latest saved non status-only memory … … 262 276 263 277 $memory = $q->execute()->getFirst(); 264 // var_dump($memory->toArray());die;265 278 266 279 return $memory; 267 280 } 281 282 283 /** 284 * Get the latest memory 285 * for the current doc 286 * 287 * @return UllFlowMemory 288 */ 289 public function findLatestMemory() 290 { 291 $q = new Doctrine_Query; 292 293 $q 294 ->from('UllFlowMemory m') 295 ->where('m.ull_flow_doc_id = ?', $this->id) 296 ->orderBy('m.created_at DESC') 297 // add order by id to order correctly memories created at exactly the same time 298 ->addOrderBy('m.id DESC') 299 ; 300 301 $memory = $q->execute()->getFirst(); 302 303 return $memory; 304 } 305 268 306 269 307 /** … … 368 406 return true; 369 407 } 370 } 408 } 409 410 411 /** 412 * Returns the URI to the edit action of the current model 413 * 414 * @return string A symfony URI 415 */ 416 public function getEditUri() 417 { 418 return 'ullFlow/edit?doc=' . $this->id; 419 } 371 420 372 421 … … 420 469 } 421 470 471 422 472 423 473 } -
trunk/plugins/ullFlowPlugin/lib/model/doctrine/PluginUllFlowMemory.class.php
r263 r1688 7 7 { 8 8 9 /** 10 * String representation 11 * 12 * @return string 13 */ 14 public function __toString() 15 { 16 return $this->UllFlowDoc->UllFlowApp->doc_label . ' "'. $this->UllFlowDoc->subject . '"'; 17 } 18 19 20 /** 21 * Returns the URI to the edit action of the current model 22 * 23 * @return string A symfony URI 24 */ 25 public function getEditUri() 26 { 27 return 'ullFlow/edit?doc=' . $this->ull_flow_doc_id; 28 } 9 29 } -
trunk/plugins/ullFlowPlugin/lib/ullFlowGenerator.class.php
r1595 r1688 70 70 $this->columnsConfig = UllFlowDocColumnConfigCollection::build( 71 71 $this->app, $this->defaultAccess, $this->requestAction); 72 73 // var_dump(ullCoreTools::debugArrayWithDoctrineRecords($this->columnsConfig, true));die; 72 74 } 73 75 -
trunk/plugins/ullFlowPlugin/modules/ullFlow/lib/BaseUllFlowActions.class.php
r1626 r1688 172 172 'doc' => $this->doc 173 173 ))); 174 175 $this->saveEffortDuration(); 174 176 175 177 if (!$this->isStatusOnlyRequestAction()) … … 921 923 ); 922 924 } 925 926 927 /** 928 * Save effort in ullTime's UllProjectReporting 929 * 930 * @return none 931 */ 932 protected function saveEffortDuration() 933 { 934 $memory = $this->doc->findLatestMemory(); 935 $projectId = $this->doc->ull_project_id; 936 $duration = $this->generator->getForm()->getValue('duration_seconds'); 937 938 if ($duration && $projectId) 939 { 940 $reporting = new UllProjectReporting; 941 $reporting->ull_project_id = $projectId; 942 $reporting->ull_user_id = sfContext::getInstance()->getUser()->getAttribute('user_id'); 943 $reporting->date = date('Y-m-d'); 944 $reporting->duration_seconds = $duration; 945 $reporting->linked_model = 'UllFlowMemory'; 946 $reporting->linked_id = $memory->id; 947 $reporting->save(); 948 } 949 } 923 950 } -
trunk/plugins/ullFlowPlugin/modules/ullFlow/templates/_ullFlowHeader.php
r1155 r1688 13 13 14 14 <div id="ull_flow_edit_header"> 15 <h1><?php echo $doc ->UllFlowApp->doc_label ?> "<?php echo $doc ?>"</h1>15 <h1><?php echo $doc ?></h1> 16 16 <div id="ull_flow_edit_header_list_container"> 17 17 <ul class="ull_flow_edit_header_list"> -
trunk/plugins/ullFlowPlugin/modules/ullFlow/templates/editSuccess.php
r1531 r1688 36 36 <div class='edit_action_buttons_left'> 37 37 38 <?php if (count($generator->getListOfUllFlowActionHandlers())) : // $step_actions and?>38 <?php if (count($generator->getListOfUllFlowActionHandlers())): ?> 39 39 40 <label for="fields_memory_comment"> 41 <?php echo __('Comment for this action') . ':'; ?> 42 </label><br /> 43 <?php echo $generator->getForm()->offsetGet('memory_comment')->render() ?> 44 <?php echo $generator->getForm()->offsetGet('memory_comment')->renderError() ?> 40 <p> 41 <label for="fields_memory_comment"> 42 <?php echo __('Comment for this action') . ':'; ?> 43 </label><br /> 44 <?php echo $generator->getForm()->offsetGet('memory_comment')->render() ?> 45 <?php echo $generator->getForm()->offsetGet('memory_comment')->renderError() ?> 46 </p> 45 47 48 <?php if ($app['enter_effort']): ?> 49 <p> 50 <label for="fields_duration_seconds"> 51 <?php echo __('Effort', null, 'ullFlowMessages') . ':'; ?> 52 </label> 53 <?php echo $generator->getForm()->offsetGet('duration_seconds')->render() ?> 54 <?php echo $generator->getForm()->offsetGet('duration_seconds')->renderError() ?> 55 <dfn><?php echo __('Hours : minutes', null, 'ullFlowMessages') ?></dfn> 56 </p> 57 <?php endif ?> 46 58 47 59 <ul> -
trunk/plugins/ullTimePlugin/config/doctrine/ullTimeSchema.yml
r1531 r1688 20 20 type: boolean 21 21 default: true 22 is_routine: 23 type: boolean 24 #is_default: 25 # type: boolean 26 # unique: true 27 22 28 23 29 UllProjectReporting: … … 42 48 type: string(4000) 43 49 week: 50 type: integer 51 linked_model: 52 type: string(128) 53 linked_id: 44 54 type: integer 45 55 relations: -
trunk/plugins/ullTimePlugin/i18n/ullTimeMessages.de.xml
r1633 r1688 170 170 </trans-unit> 171 171 172 <trans-unit id="3 3">172 <trans-unit id="34"> 173 173 <source>Difference</source> 174 174 <target>Differenz</target> 175 175 </trans-unit> 176 176 177 <trans-unit id="35"> 178 <source>Routine</source> 179 <target>Routine</target> 180 </trans-unit> 181 182 <trans-unit id="36"> 183 <source>Default</source> 184 <target>Standard</target> 185 </trans-unit> 177 186 178 187 </body> -
trunk/plugins/ullTimePlugin/lib/generator/columnConfigCollection/base/BaseUllProjectColumnConfigCollection.class.php
r1395 r1688 14 14 $this['created_at']->enable(); 15 15 } 16 17 $this['is_routine']->setLabel(__('Routine', null, 'ullTimeMessages')); 18 19 //$this['is_default']->setLabel(__('Default', null, 'ullTimeMessages')); 16 20 } 17 21 } -
trunk/plugins/ullTimePlugin/lib/generator/columnConfigCollection/base/BaseUllProjectReportingColumnConfigCollection.class.php
r1416 r1688 10 10 protected function applyCustomSettings() 11 11 { 12 $this['id']->disable(); 12 $this->disable(array( 13 'id', 14 'linked_model', 15 'linked_id', 16 )); 17 13 18 if ($this->isListAction()) 14 19 { -
trunk/plugins/ullTimePlugin/lib/model/doctrine/PluginUllProjectReporting.class.php
r1127 r1688 19 19 } 20 20 21 22 /** 23 * Get string representation for linked models 24 * 25 * @return string 26 */ 27 public function getComment() 28 { 29 if ($this->linked_id) 30 { 31 $model = Doctrine::getTable($this->linked_model)->findOneById($this->linked_id); 32 33 $return = '<a href="' . url_for($model->getEditUri()) . '">' . 34 $model . '</a>'; 35 36 return $return; 37 } 38 39 return $this->_get('comment'); 40 } 41 21 42 } -
trunk/plugins/ullTimePlugin/modules/ullTime/templates/editProjectSuccess.php
r1633 r1688 40 40 </td> 41 41 42 <?php echo $form ?> 42 <?php // special handling for comment -> decode for usable link ?> 43 <?php foreach ($list_generator->getAutoRenderedColumns() as $column_name => $column_config): ?> 44 <td> 45 <?php if ($column_name == 'comment'): ?> 46 <?php echo html_entity_decode($form[$column_name], ENT_QUOTES, 'UTF-8') ?> 47 <?php else: ?> 48 <?php echo $form[$column_name] ?> 49 <?php endif ?> 50 </td> 51 <?php endforeach ?> 52 43 53 </tr> 44 54 <?php endforeach; ?> -
trunk/test/functional/frontend/ullFlowPlugin/ullFlowCrudTest.php
r1656 r1688 33 33 ->isRequestParameter('action', 'create') 34 34 ->isRequestParameter('app', 'trouble_ticket') 35 ->checkResponseElement($dgsEditTT->getFullRowSelector(), 8) // number of displayed fields35 ->checkResponseElement($dgsEditTT->getFullRowSelector(), 9) // number of displayed fields 36 36 ->checkResponseElement($dgsEditTT->get('priority', 'value') . ' > select > option[selected="selected"]', 'Normal') 37 37 ->checkResponseElement('ul.tag-cloud a ', 'ull_flow_tag1') … … 55 55 ->checkResponseElement($dgsEditTT->get('email', 'error') . ' > ul > li', 'Invalid.') 56 56 ->checkResponseElement($dgsEditTT->get('priority', 'value') . ' select > option[selected="selected"]', 'High') 57 ->checkResponseElement($dgsEditTT->get('project', 'error') . ' > ul > li', 'Required.') 57 58 ->setField('fields[my_subject]', 'This is my original shiny little subject') 58 59 ->setField('fields[my_date]', "2001-01-01 12:12:12") 59 60 ->setField('fields[my_email]', 'bender@ull.at') 61 ->setField('fields[my_project]', 1) 60 62 ; 61 63 62 $b->diag('check values and click "save_ close"')64 $b->diag('check values and click "save_only"') 63 65 ->click('Save only') 64 66 ->isRedirected() … … 149 151 ->isRequestParameter('app', 'trouble_ticket') 150 152 ->setField('fields[my_subject]', 'tag: <i>italy</i>') 153 ->setField('fields[my_project]', 1) 151 154 ->click('Save and return to list') 152 155 ->isRedirected() -
trunk/test/functional/frontend/ullFlowPlugin/ullFlowWorkflowTest.php
r1496 r1688 32 32 ->isRequestParameter('app', 'trouble_ticket') 33 33 ->setField('fields[my_subject]', 'Urgently use ullright') 34 ->setField('fields[my_project]', 1) 34 35 ->click('Send') 35 36 ->isRedirected() -
trunk/test/unit/ullFlowPlugin/UllFlowDocTest.php
r1460 r1688 10 10 sfContext::createInstance($configuration); 11 11 12 $t = new myTestCase( 58, new lime_output_color, $configuration);12 $t = new myTestCase(63, new lime_output_color, $configuration); 13 13 $path = dirname(__FILE__); 14 14 $t->setFixturesPath($path); … … 25 25 $doc->my_priority = 5; 26 26 $doc->my_tags = 'footag'; 27 $doc->my_project = 2; 27 28 $doc->memory_comment = 'My fancy memory comment'; 28 29 … … 43 44 $t->is($doc->subject, 'My fancy subject', 'sets the native subject duplicate correctly'); 44 45 $t->is($doc->priority, 5, 'sets native priority duplicate correctly'); 46 $t->is($doc->ull_project_id, 2, 'sets native ull_project_id duplicate correctly'); 45 47 $t->is($doc->duplicate_tags_for_search, 'footag', 'sets the native tagging duplicate correctly'); 46 48 $t->is($doc->ull_flow_action_id, Doctrine::getTable('UllFlowAction')->findOneBySlug('save_close')->id, 'sets the action correctly (default)'); … … 50 52 $t->is($doc->my_date, '2008-08-08 08:08:08', 'sets the correct virtual columns value'); 51 53 $t->is($doc->my_priority, 5, 'sets the correct virtual columns value'); 54 $t->is($doc->my_project, 2, 'sets the correct virtual columns value'); 52 55 $t->is($doc->my_tags, 'footag', 'sets the correct virtual columns value'); 53 56 try … … 127 130 128 131 $t->is($doc->findLatestNonStatusOnlyMemory()->id, $doc->UllFlowMemories[4]->id, 'finds the correct latest non status-only memory'); 132 133 $t->diag('findLatestMemory()'); 134 135 $t->is($doc->findLatestMemory()->id, $doc->UllFlowMemories[4]->id, 'finds the correct latest memory'); 129 136 130 137 $t->diag('findPreviousNonStatusOnlyMemory()'); … … 151 158 'my_upload' => 'Icons.zip;/uploads/ullFlow/bug_tracking/215/2008-11-13-09-37-41_Icons.zip;application/zip;1;2008-11-13 09:37:41', 152 159 'my_wiki_link' => '1', 160 'my_project' => 1, 153 161 'my_tags' => 'ull_flow_tag1, ull_flow_tag2', 154 162 ); … … 167 175 'my_upload', 168 176 'my_wiki_link', 177 'my_project', 169 178 'my_tags', 170 179 ); … … 211 220 $t->loginAs('helpdesk_user'); 212 221 $doc = Doctrine::getTable('UllFlowDoc')->find(1); 213 $t->ok(!$doc->checkDeleteAccess(), 'disallows access for someone else'); 222 $t->ok(!$doc->checkDeleteAccess(), 'disallows access for someone else'); 223 224 225 $t->diag('__toString()'); 226 $doc = Doctrine::getTable('UllFlowDoc')->find(1); 227 $t->is((string) $doc, 'Trouble ticket "My first trouble ticket"', 'Returns the correct value when casted to string'); 228 229 230 $t->diag('getEditUri()'); 231 $doc = Doctrine::getTable('UllFlowDoc')->find(1); 232 $t->is($doc->getEditUri(), 'ullFlow/edit?doc=1', 'Returns the correct uri for edit'); -
trunk/test/unit/ullFlowPlugin/ullFlowGeneratorTest.php
r1663 r1688 54 54 $this->columnsConfigMock['my_wiki_link'] = $columnConfig; 55 55 56 $columnConfig = new ullColumnConfiguration('my_project'); 57 $columnConfig->setWidgetOptions(array('add_empty' => 1, 'model' => 'UllProject')); 58 $columnConfig->setValidatorOptions(array('required' => true)); 59 $columnConfig->setLabel('Project'); 60 $columnConfig->setMetaWidgetClassName('ullMetaWidgetUllProject'); 61 $columnConfig->setIsInList(false); 62 $this->columnsConfigMock['my_project'] = $columnConfig; 63 56 64 $columnConfig = new ullColumnConfiguration('my_tags'); 57 65 $columnConfig->setLabel('Tags'); … … 90 98 sfLoader::loadHelpers('I18N'); 91 99 92 $t = new myTestCase(1 04, new lime_output_color, $configuration);100 $t = new myTestCase(115, new lime_output_color, $configuration); 93 101 $path = dirname(__FILE__); 94 102 $t->setFixturesPath($path); … … 117 125 'columnsConfig is an UllFlowDocColumnConfigCollection'); 118 126 119 $t->is(count($columnsConfig), 2 2, 'columnsConfig has the correct number of columns');127 $t->is(count($columnsConfig), 24, 'columnsConfig has the correct number of columns'); 120 128 121 129 //we really should take ordering into account here... … … 157 165 $generator->buildListOfUllFlowActionHandlers(); 158 166 159 $t->is(count($generator->getForm()->getFormFieldSchema()), 1 0, 'The form now contains one more field from the action handler');167 $t->is(count($generator->getForm()->getFormFieldSchema()), 12, 'The form now contains one more field from the action handler'); 160 168 161 169 -
trunk/test/unit/ullTimePlugin/UllProjectReportingTest.php
r1127 r1688 10 10 sfContext::createInstance($configuration); 11 11 12 $t = new myTestCase(2, new lime_output_color, $configuration); 12 sfLoader::loadHelpers('Url'); 13 14 $t = new myTestCase(4, new lime_output_color, $configuration); 13 15 $path = dirname(__FILE__); 14 16 $t->setFixturesPath($path); … … 24 26 $report->UllProject = $project; 25 27 $report->duration_seconds = 3600; 28 $report->comment = 'Foo bar'; 26 29 $report->save(); 27 30 … … 31 34 $report->save(); 32 35 $t->is($report->week, '200939', 'Generates the correct week upon update'); 36 37 38 $t->diag('getComment()'); 39 $t->is($report['comment'], 'Foo bar', 'Returns the correct comment for a native project effort'); 40 41 $report = new UllProjectReporting; 42 $report->UllUser = $user; 43 $report->date = '2009-09-18'; 44 $report->UllProject = $project; 45 $report->duration_seconds = 3600; 46 $report->linked_model = 'UllFlowMemory'; 47 $report->linked_id = 1; 48 49 $t->is($report['comment'], '<a href="' . url_for('ullFlow/edit?doc=1') . '">Trouble ticket "My first trouble ticket"</a>', 'Returns the correct comment for a linked UllFlowDoc entry'); 50 51
