Changeset 1084 for trunk


Ignore:
Timestamp:
12/21/09 17:09:07 (2 years ago)
Author:
bogdan2412
Message:

Script to add author tags to tasks.

Tries and determine each author correctly for tasks with multiple ones and groups together different spellings of names (for example Baltescu Paul and Paul-Dan Baltescu) :P

Also makes task_edit controller update author in ia_task to reflect the tags.

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/db/tags.php

    r1081 r1084  
    2525        $query .= sprintf(" WHERE %s", implode(" AND ", $where)); 
    2626    } 
     27    $query .= " ORDER BY name"; 
    2728    return db_fetch_all($query); 
    2829} 
     
    4748        FROM ia_%s_tags AS obj_tags 
    4849        LEFT JOIN ia_tags AS tags ON obj_tags.tag_id = tags.id 
    49         WHERE %s_id = %s%s%s", 
     50        WHERE %s_id = %s%s%s 
     51        ORDER BY tag_name", 
    5052        db_escape($obj), db_escape($obj), db_escape($obj), 
    5153        db_quote($obj_id), $where_type, $where_parent 
  • trunk/www/controllers/task.php

    r1083 r1084  
    4343 
    4444    // Fill in form values from request, defaults in $task 
    45     $fields = array('author', 'type', 'source', 'hidden', 'title', 'page_name', 
     45    $fields = array('type', 'source', 'hidden', 'title', 'page_name', 
    4646                    'open_source', 'open_tests', 'test_count', 'test_groups', 
    4747                    'evaluator', 'use_ok_files', 'public_tests'); 
     
    146146            // FIXME: error handling? Is that even remotely possible in php? 
    147147            task_update_parameters($task_id, $new_task_params); 
    148             task_update($new_task); 
    149148 
    150149            if (identity_can('task-tag', $new_task)) { 
     
    160159                } 
    161160            } 
     161            $new_task["author"] = tag_build_list("task", $new_task["id"], "author"); 
     162            task_update($new_task); 
    162163 
    163164            flash("Task-ul a fost modificat cu succes."); 
  • trunk/www/views/task_edit.php

    r1083 r1084  
    2929                'description' => "Utilizatorul care are drepturi de editare ". 
    3030                                 "asupra problemei. Poate fi lasat gol.", 
    31                 'type' => 'string', 
    32         ), 
    33         'author' => array( 
    34                 'name' => "Autor(i)", 
    3531                'type' => 'string', 
    3632        ), 
     
    120116            <?= view_form_field_li($form_fields['user'], 'user') ?> 
    121117        <?php } ?> 
    122         <?= view_form_field_li($form_fields['author'], 'author') ?> 
    123118        <?= view_form_field_li($form_fields['source'], 'source') ?> 
    124119        <?php if (identity_can('task-change-security', $task)) { ?> 
Note: See TracChangeset for help on using the changeset viewer.