Changeset 1106 for trunk


Ignore:
Timestamp:
03/14/10 18:30:11 (2 years ago)
Author:
gcosmin
Message:

You can now deselect all tags for a task
review url: http://reviewboard.infoarena.ro/r/133/

Location:
trunk
Files:
3 edited

Legend:

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

    r1099 r1106  
    6161// Each parent id appears only once 
    6262function tag_get_parents($tag_ids) { 
     63    if (count($tag_ids) == 0) { 
     64        return array(); 
     65    } 
     66 
    6367    $query = sprintf("SELECT DISTINCT(`parent`) 
    6468            FROM ia_tags 
     
    103107// Get a list of tags from a list of tag ids 
    104108function tag_get_by_ids($tag_ids) { 
     109    if (count($tag_ids) == 0) { 
     110        return array(); 
     111    } 
     112 
    105113    $query = sprintf( 
    106114            "SELECT `id`, `name`, `type`, `parent` 
  • trunk/common/tags.php

    r1099 r1106  
    8383    foreach ($tags_by_id as &$tag) { 
    8484        if (!isset($has_parent[$tag["id"]])) { 
     85            // Set the array for the tags with no parents and no children 
     86            if (!isset($tag["sub_tags"])) { 
     87                $tag["sub_tags"] = array(); 
     88            } 
    8589            $roots[] = $tag; 
    8690        } 
  • trunk/www/controllers/task.php

    r1099 r1106  
    284284 
    285285    if (request_is_post()) { 
    286         $algorithm_tags_id = request("algorithm_tags"); 
     286        $algorithm_tags_id = request("algorithm_tags", array()); 
    287287        $method_tags_id = tag_get_parents($algorithm_tags_id); 
    288288 
    289289        if (!is_array($algorithm_tags_id)) { 
    290290            flash_error("Datele trimise sunt invalide. Raporteaza aceasta problema unui admin."); 
    291             redirect(url_task_edit_tag($task_id)); 
     291            redirect(url_task_edit_tags($task_id)); 
    292292        } 
    293293 
     
    295295            if (!is_tag_id($tag_id)) { 
    296296                flash_error("Datele trimise sunt invalide. Raporteaza aceasta problema unui admin."); 
    297                 redirect(url_task_edit_tag($task_id)); 
     297                redirect(url_task_edit_tags($task_id)); 
    298298            } 
    299299        } 
     
    308308        if ($count != count($algorithm_tags_id)) { 
    309309            flash_error("Datele trimise sunt invalide. Raporteaza aceasta problema unui admin."); 
    310             redirect(url_task_edit_tag($task_id)); 
     310            redirect(url_task_edit_tags($task_id)); 
    311311        } 
    312312 
Note: See TracChangeset for help on using the changeset viewer.