Changeset 1688

Show
Ignore:
Timestamp:
03/09/10 09:21:05 (5 months ago)
Author:
klemens
Message:

ullFlow -> ullTime integration

Location:
trunk
Files:
5 added
27 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ullCorePlugin/data/fixtures/ullCoreFixtures.yml

    r1679 r1688  
    280280    class:        ullMetaWidgetPhoneNumber 
    281281    label:        PhoneNumber 
    282     namespace:    ullCore     
     282    namespace:    ullCore 
     283  ull_project: 
     284    class:        ullMetaWidgetUllProject 
     285    label:        UllProject 
     286    namespace:    ullCore           
    283287   
    284288UllSelect: 
  • trunk/plugins/ullCorePlugin/lib/form/widget/ullMetaWidgetForeignKey.class.php

    r1136 r1688  
    1111  protected function configure() 
    1212  { 
    13     $relation = $this->columnConfig->getRelation(); 
    1413    if (!$this->columnConfig->getWidgetOption('model')) 
    1514    { 
     15      $relation = $this->columnConfig->getRelation(); 
    1616      $this->columnConfig->setWidgetOption('model', $relation['model']); 
    17     } 
     17    }     
    1818  } 
    1919     
     
    4747   * Parse options 
    4848   *  
     49   * Only for write mode 
     50   *  
    4951   * @return unknown_type 
    5052   */ 
    5153  protected function parseOptions() 
    5254  { 
    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     
    5665     
    5766    // the dropdown field can't be mandatory in case of allowCreate 
  • trunk/plugins/ullCorePlugin/lib/ullTestBrowser.class.php

    r1674 r1688  
    209209        'attachments', 
    210210        'wiki_links', 
     211        'project', 
    211212        'tags', 
    212213      ),       
  • trunk/plugins/ullFlowPlugin/config/doctrine/ullFlowSchema.yml

    r1469 r1688  
    2020    is_public: 
    2121      type: boolean 
     22    enter_effort: 
     23      type: boolean 
    2224  relations: 
    2325    UllPermission: 
     
    7072    #this is used to set the record always dirty, even when only virtual columns are changed.     
    7173    dirty: 
     74      type: integer 
     75    ull_project_id: 
    7276      type: integer 
    7377  relations: 
     
    8993      foreignType: one 
    9094      type: many 
     95    UllProject: 
    9196       
    9297UllFlowColumnConfig: 
     
    128133      type: boolean 
    129134      default: false 
     135    is_project: 
     136      type: boolean 
     137      default: false       
    130138    default_value: 
    131139      type: string(255)       
     
    188196    creator_ull_entity_id: 
    189197      type: integer 
    190       notnull: true       
     198      notnull: true 
     199    durations_seconds: 
     200      type: integer       
    191201  relations: 
    192202    UllFlowDoc: 
  • trunk/plugins/ullFlowPlugin/data/fixtures/ullFlowFixtures.yml

    r1663 r1688  
    7777    list_columns:   id,subject,priority,assigned_to_ull_entity_id,created_at 
    7878    #is_public:      true 
     79    enter_effort:   true 
    7980  ull_flow_app_todo: 
    8081    Translation: 
     
    106107    created_at:     '2001-01-01 01:01:01' 
    107108    duplicate_tags_for_search: ull_flow_tag1, ull_flow_tag2 
     109    ull_project_id: 1 
    108110    namespace:      test 
    109111  ull_flow_doc_trouble_ticket2: 
     
    113115    UllEntity:      helpdesk_group 
    114116    UllFlowStep:    ull_flow_step_doc_trouble_ticket_dispatcher 
     117    ull_project_id: 1 
    115118    namespace:      test 
    116119  ull_flow_doc_todo1: 
     
    175178    UllColumnType:  date 
    176179    namespace:      test 
     180     
    177181  ull_flow_column_config_trouble_ticket_email: 
    178182    Translation: 
     
    223227    UllColumnType:  wiki_link 
    224228    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     
    225245  ull_flow_column_config_trouble_ticket_column_tags: 
    226246    Translation: 
     
    310330    UllFlowColumnConfig: ull_flow_column_config_trouble_ticket_wiki_link 
    311331    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       
    313338  ull_flow_value_doc_trouble_ticket1_column_tags: 
    314339    UllFlowDoc:     ull_flow_doc_trouble_ticket1 
     
    332357    value:          bender@ull.at 
    333358    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      
    334364     
    335365  ull_flow_value_doc_todo1_subject: 
  • trunk/plugins/ullFlowPlugin/i18n/ullFlowMessages.de.xml

    r1595 r1688  
    9999        <target>Ist Tagging-Spalte?</target> 
    100100      </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 
    101117 
    102118      <!-- Queries --> 
     
    125141        <target>ZuweisungsÃŒbersicht</target> 
    126142      </trans-unit>       
     143 
     144 
    127145 
    128146      <!-- table config --> 
  • trunk/plugins/ullFlowPlugin/lib/UllFlowDocRecordFilter.class.php

    r1460 r1688  
    5959      $record->priority = $value; 
    6060    } 
     61    if ($cc->is_project) 
     62    { 
     63      $record->ull_project_id = $value; 
     64    }     
    6165    if ($cc->is_tagging) 
    6266    { 
  • trunk/plugins/ullFlowPlugin/lib/form/ullFlowForm.php

    r1631 r1688  
    2525      $this->getWidgetSchema()->offsetSet('memory_comment', new sfWidgetFormInput(array(), array('size' => 50))); 
    2626      $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))); 
    2730    }     
    2831  } 
  • trunk/plugins/ullFlowPlugin/lib/generator/columnConfigCollection/UllFlowAppColumnConfigCollection.class.php

    r1111 r1688  
    1111    $this['doc_label']->setLabel(__('Label of a document', null, 'ullFlowMessages')); 
    1212    $this['list_columns']->setLabel(__('List of result list columns', null, 'ullFlowMessages')); 
     13    $this['enter_effort']->setLabel(__('Enter effort', null, 'ullFlowMessages')); 
    1314  } 
    1415} 
  • trunk/plugins/ullFlowPlugin/lib/generator/columnConfigCollection/UllFlowDocColumnConfigCollection.class.php

    r1469 r1688  
    129129            $this[$columnName]->setDefaultValue($column->default_value); 
    130130          } 
     131           
     132//          if ($column->UllColumnType->class == 'UllProject') 
     133//          { 
     134//            $this[$columnName]->setRelation 
     135//          } 
    131136        } 
    132137      } 
  • trunk/plugins/ullFlowPlugin/lib/model/doctrine/PluginUllFlowDoc.class.php

    r1628 r1688  
    99  protected 
    1010    $memoryComment = '', 
     11    $memoryDuration = 0, 
    1112    $memoryAction = null 
    1213  ; 
     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   
    1326   
    1427  // TODO: give UllFlowApp in the constructor to force check if  
     
    87100    return $this->memoryComment; 
    88101  } 
    89  
     102   
    90103  /** 
    91104   * Sets a custom UllFlowMemory action. 
     
    242255  } 
    243256 
     257   
    244258  /** 
    245259   * Get the latest saved non status-only memory 
     
    262276     
    263277    $memory = $q->execute()->getFirst(); 
    264 //    var_dump($memory->toArray());die; 
    265278 
    266279    return $memory; 
    267280  } 
     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     
    268306   
    269307  /** 
     
    368406      return true; 
    369407    } 
    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  }   
    371420   
    372421   
     
    420469  } 
    421470   
     471 
    422472   
    423473} 
  • trunk/plugins/ullFlowPlugin/lib/model/doctrine/PluginUllFlowMemory.class.php

    r263 r1688  
    77{ 
    88 
     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  }     
    929} 
  • trunk/plugins/ullFlowPlugin/lib/ullFlowGenerator.class.php

    r1595 r1688  
    7070    $this->columnsConfig = UllFlowDocColumnConfigCollection::build( 
    7171        $this->app, $this->defaultAccess, $this->requestAction); 
     72         
     73//    var_dump(ullCoreTools::debugArrayWithDoctrineRecords($this->columnsConfig, true));die; 
    7274  } 
    7375   
  • trunk/plugins/ullFlowPlugin/modules/ullFlow/lib/BaseUllFlowActions.class.php

    r1626 r1688  
    172172          'doc'        => $this->doc 
    173173        ))); 
     174         
     175        $this->saveEffortDuration(); 
    174176 
    175177        if (!$this->isStatusOnlyRequestAction()) 
     
    921923    );   
    922924  } 
     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  }   
    923950} 
  • trunk/plugins/ullFlowPlugin/modules/ullFlow/templates/_ullFlowHeader.php

    r1155 r1688  
    1313 
    1414<div id="ull_flow_edit_header"> 
    15         <h1><?php echo $doc->UllFlowApp->doc_label ?> "<?php echo $doc ?>"</h1> 
     15        <h1><?php echo $doc ?></h1> 
    1616        <div id="ull_flow_edit_header_list_container"> 
    1717                <ul class="ull_flow_edit_header_list"> 
  • trunk/plugins/ullFlowPlugin/modules/ullFlow/templates/editSuccess.php

    r1531 r1688  
    3636      <div class='edit_action_buttons_left'> 
    3737       
    38       <?php if (count($generator->getListOfUllFlowActionHandlers())) : // $step_actions and ?> 
     38      <?php if (count($generator->getListOfUllFlowActionHandlers())): ?> 
    3939         
    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> 
    4547         
     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 ?> 
    4658         
    4759        <ul> 
  • trunk/plugins/ullTimePlugin/config/doctrine/ullTimeSchema.yml

    r1531 r1688  
    2020      type: boolean 
    2121      default: true 
     22    is_routine: 
     23      type: boolean 
     24    #is_default: 
     25    #  type: boolean 
     26    #  unique: true       
     27       
    2228 
    2329UllProjectReporting: 
     
    4248      type: string(4000) 
    4349    week: 
     50      type: integer 
     51    linked_model: 
     52      type: string(128) 
     53    linked_id: 
    4454      type: integer 
    4555  relations: 
  • trunk/plugins/ullTimePlugin/i18n/ullTimeMessages.de.xml

    r1633 r1688  
    170170</trans-unit> 
    171171 
    172 <trans-unit id="33"> 
     172<trans-unit id="34"> 
    173173<source>Difference</source> 
    174174<target>Differenz</target> 
    175175</trans-unit> 
    176176 
     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> 
    177186 
    178187    </body> 
  • trunk/plugins/ullTimePlugin/lib/generator/columnConfigCollection/base/BaseUllProjectColumnConfigCollection.class.php

    r1395 r1688  
    1414      $this['created_at']->enable(); 
    1515    } 
     16     
     17    $this['is_routine']->setLabel(__('Routine', null, 'ullTimeMessages')); 
     18     
     19    //$this['is_default']->setLabel(__('Default', null, 'ullTimeMessages'));       
    1620  } 
    1721} 
  • trunk/plugins/ullTimePlugin/lib/generator/columnConfigCollection/base/BaseUllProjectReportingColumnConfigCollection.class.php

    r1416 r1688  
    1010  protected function applyCustomSettings() 
    1111  { 
    12     $this['id']->disable(); 
     12    $this->disable(array( 
     13      'id', 
     14      'linked_model', 
     15      'linked_id', 
     16    )); 
     17     
    1318    if ($this->isListAction()) 
    1419    { 
  • trunk/plugins/ullTimePlugin/lib/model/doctrine/PluginUllProjectReporting.class.php

    r1127 r1688  
    1919  } 
    2020 
     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 
    2142} 
  • trunk/plugins/ullTimePlugin/modules/ullTime/templates/editProjectSuccess.php

    r1633 r1688  
    4040      </td> 
    4141       
    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       
    4353    </tr> 
    4454  <?php endforeach; ?> 
  • trunk/test/functional/frontend/ullFlowPlugin/ullFlowCrudTest.php

    r1656 r1688  
    3333  ->isRequestParameter('action', 'create') 
    3434  ->isRequestParameter('app', 'trouble_ticket') 
    35   ->checkResponseElement($dgsEditTT->getFullRowSelector(), 8) // number of displayed fields 
     35  ->checkResponseElement($dgsEditTT->getFullRowSelector(), 9) // number of displayed fields 
    3636  ->checkResponseElement($dgsEditTT->get('priority', 'value') . ' > select > option[selected="selected"]', 'Normal') 
    3737  ->checkResponseElement('ul.tag-cloud a ', 'ull_flow_tag1') 
     
    5555  ->checkResponseElement($dgsEditTT->get('email', 'error') . ' > ul > li', 'Invalid.') 
    5656  ->checkResponseElement($dgsEditTT->get('priority', 'value') . ' select > option[selected="selected"]', 'High') 
     57  ->checkResponseElement($dgsEditTT->get('project', 'error') . ' > ul > li', 'Required.') 
    5758  ->setField('fields[my_subject]', 'This is my original shiny little subject') 
    5859  ->setField('fields[my_date]', "2001-01-01 12:12:12")     
    5960  ->setField('fields[my_email]', 'bender@ull.at') 
     61  ->setField('fields[my_project]', 1) 
    6062; 
    6163   
    62 $b->diag('check values and click "save_close"')   
     64$b->diag('check values and click "save_only"')   
    6365  ->click('Save only') 
    6466  ->isRedirected() 
     
    149151  ->isRequestParameter('app', 'trouble_ticket') 
    150152  ->setField('fields[my_subject]', 'tag: <i>italy</i>') 
     153  ->setField('fields[my_project]', 1) 
    151154  ->click('Save and return to list') 
    152155  ->isRedirected() 
  • trunk/test/functional/frontend/ullFlowPlugin/ullFlowWorkflowTest.php

    r1496 r1688  
    3232  ->isRequestParameter('app', 'trouble_ticket') 
    3333  ->setField('fields[my_subject]', 'Urgently use ullright') 
     34  ->setField('fields[my_project]', 1) 
    3435  ->click('Send') 
    3536  ->isRedirected() 
  • trunk/test/unit/ullFlowPlugin/UllFlowDocTest.php

    r1460 r1688  
    1010sfContext::createInstance($configuration); 
    1111 
    12 $t = new myTestCase(58, new lime_output_color, $configuration); 
     12$t = new myTestCase(63, new lime_output_color, $configuration); 
    1313$path = dirname(__FILE__); 
    1414$t->setFixturesPath($path); 
     
    2525  $doc->my_priority = 5; 
    2626  $doc->my_tags = 'footag'; 
     27  $doc->my_project = 2; 
    2728  $doc->memory_comment = 'My fancy memory comment'; 
    2829   
     
    4344  $t->is($doc->subject, 'My fancy subject', 'sets the native subject duplicate correctly'); 
    4445  $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'); 
    4547  $t->is($doc->duplicate_tags_for_search, 'footag', 'sets the native tagging duplicate correctly'); 
    4648  $t->is($doc->ull_flow_action_id, Doctrine::getTable('UllFlowAction')->findOneBySlug('save_close')->id, 'sets the action correctly (default)'); 
     
    5052  $t->is($doc->my_date, '2008-08-08 08:08:08', 'sets the correct virtual columns value'); 
    5153  $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'); 
    5255  $t->is($doc->my_tags, 'footag', 'sets the correct virtual columns value'); 
    5356  try 
     
    127130 
    128131  $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');   
    129136  
    130137$t->diag('findPreviousNonStatusOnlyMemory()'); 
     
    151158    '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', 
    152159    'my_wiki_link' => '1', 
     160    'my_project'  => 1, 
    153161    'my_tags'     => 'ull_flow_tag1, ull_flow_tag2', 
    154162  ); 
     
    167175    'my_upload', 
    168176    'my_wiki_link', 
     177    'my_project', 
    169178    'my_tags', 
    170179  ); 
     
    211220  $t->loginAs('helpdesk_user'); 
    212221  $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  
    5454    $this->columnsConfigMock['my_wiki_link'] = $columnConfig; 
    5555     
     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     
    5664    $columnConfig = new ullColumnConfiguration('my_tags'); 
    5765    $columnConfig->setLabel('Tags'); 
     
    9098sfLoader::loadHelpers('I18N'); 
    9199 
    92 $t = new myTestCase(104, new lime_output_color, $configuration); 
     100$t = new myTestCase(115, new lime_output_color, $configuration); 
    93101$path = dirname(__FILE__); 
    94102$t->setFixturesPath($path); 
     
    117125    'columnsConfig is an UllFlowDocColumnConfigCollection'); 
    118126   
    119   $t->is(count($columnsConfig), 22, 'columnsConfig has the correct number of columns'); 
     127  $t->is(count($columnsConfig), 24, 'columnsConfig has the correct number of columns'); 
    120128   
    121129  //we really should take ordering into account here... 
     
    157165  $generator->buildListOfUllFlowActionHandlers(); 
    158166   
    159   $t->is(count($generator->getForm()->getFormFieldSchema()), 10, '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'); 
    160168 
    161169   
  • trunk/test/unit/ullTimePlugin/UllProjectReportingTest.php

    r1127 r1688  
    1010sfContext::createInstance($configuration); 
    1111 
    12 $t = new myTestCase(2, new lime_output_color, $configuration); 
     12sfLoader::loadHelpers('Url'); 
     13 
     14$t = new myTestCase(4, new lime_output_color, $configuration); 
    1315$path = dirname(__FILE__); 
    1416$t->setFixturesPath($path); 
     
    2426  $report->UllProject = $project; 
    2527  $report->duration_seconds = 3600; 
     28  $report->comment = 'Foo bar'; 
    2629  $report->save(); 
    2730   
     
    3134  $report->save(); 
    3235  $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