Changeset 5761

Show
Ignore:
Timestamp:
05/22/08 15:43:06 (2 years ago)
Author:
uta
Message:

2008/05/22 sync

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • components/todo_list/trunk/todo_list/_install/db/001_todo_list_schema_001.rb

    r5721 r5761  
    11class TodoListSchema001 < ActiveRecord::Migration 
     2  ###################################################################################################################### 
     3  # Temp Class 
     4  ###################################################################################################################### 
     5  class TodoList::TodoListConfig < ActiveRecord::Base 
     6    def self.instance 
     7      self.find(1) 
     8    end 
     9  end 
     10 
    211  def self.up 
    312    #################################################################################################################### 
     
    3443      t.column :title,                                  :string,    :limit => 90,   :default => '',     :null => false 
    3544    end 
    36      
     45 
    3746    create_table :todo_list_configs, :force => true do |t| 
    3847      t.column :site_reminder_flag,                     :integer,                   :default => 0,      :null => false 
     
    4655    add_index(:todo_list_todos,             [:rubricks_user_id_owner, :closed_flag, :delete_flag, :reminder_flag, :close_on],  {:name => 'todo_list_todos_idx_1'}) 
    4756    add_index(:todo_list_category_boxes,    [:rubricks_user_id, :id],                                                          {:name => 'todo_list_category_boxes_idx_1'}) 
     57 
     58    #################################################################################################################### 
     59    # Data 
     60    #################################################################################################################### 
     61    TodoList::TodoListConfig.create({:site_reminder_flag => 1, :site_remind_hour => 0, :site_remind_min => 0}) 
    4862  end 
    4963   
  • components/todo_list/trunk/todo_list/_install/db/002_todo_list_schema_002.rb

    r5725 r5761  
    1515    #################################################################################################################### 
    1616    TodoList::TodoListTodo.delete_all('delete_flag = 1') 
     17    TodoList::TodoListTodo.find(:all).each do |tlt| 
     18      if tlt.progress % 10 != 0 
     19        tlt.progress = (tlt.progress / 10).floor * 10 
     20        tlt.save 
     21      end 
     22    end 
    1723    menu_icon = RubricksMenuIcon.find_by_title('[_TodoList_Title]') 
    1824    menu_icon.update_attributes(:title => '[_TodoList_Info_DisplayName]') unless menu_icon.blank? 
     
    3844    remove_column :todo_list_todos,     :category 
    3945    change_column :todo_list_configs,   :site_reminder_flag,        :boolean,                   :default => false,  :null => false 
    40  
    41     #################################################################################################################### 
    42     # Indexes 
    43     #################################################################################################################### 
    44     remove_index(:todo_list_todos,      {:name => 'todo_list_todos_idx_1'}) 
    45     add_index(:todo_list_todos,         [:todo_list_category_box_id, :closed_on], {:name => 'todo_list_todos_idx_1'}) 
    4646  end 
    4747 
  • components/todo_list/trunk/todo_list/_install/javascripts/src_todo.js

    r5721 r5761  
    88    rubricks.common.FormEditor.readMode('todo_edit_area', 'todo_edit_form'); 
    99    this.admin_toggle_reminder_flag(); 
     10  }, 
     11  admin_print: function() { 
     12    rubricks.common.fire_submit('todo_list_admin_print_form', 'print_button'); 
     13    rubricks.common.rubricks_wait_message_close(); 
    1014  }, 
    1115  admin_toggle_reminder_flag: function() { 
     
    6771    ); 
    6872  }, 
     73  common_todo_allot_to_clear: function() { 
     74    var el; 
     75    el = $('todo_allot_to'); 
     76    if(el) { 
     77      el.value = ''; 
     78      $('todo_allot_to_display').value = ''; 
     79    } 
     80    el = $('todo_edit_allot_to'); 
     81    if(el) { 
     82      el.value = ''; 
     83      $('todo_edit_allot_to_display').value = ''; 
     84    } 
     85  }, 
     86  common_todo_allot_to_set: function(data) { 
     87    if(data) { 
     88      var el; 
     89      el = $('todo_allot_to'); 
     90      if(el) { 
     91        el.value = data.id; 
     92        $('todo_allot_to_display').value = data.name.unescapeHTML(); 
     93      } 
     94      el = $('todo_edit_allot_to'); 
     95      if(el) { 
     96        el.value = data.id; 
     97        $('todo_edit_allot_to_display').value = data.name.unescapeHTML(); 
     98      } 
     99    } else { 
     100      this.common_todo_allot_to_clear(); 
     101    } 
     102  }, 
     103  common_todo_allot_to_window_close: function() { 
     104    this.todo_allot_to_window.close(); 
     105  }, 
     106  common_todo_allot_to_window_open: function() { 
     107    if(this.flg_todo_allot_to_window_loaded) { 
     108      this.rollover(); 
     109      this.todo_allot_to_window.center(); 
     110      this.todo_allot_to_window.open(); 
     111    } else { 
     112      this.common_todo_allot_to_window_render(); 
     113    } 
     114  }, 
     115  common_todo_allot_to_window_render: function() { 
     116    new Ajax.Updater( 
     117      'todo_allot_to_window_frame', 
     118      rubricks.todo_list.url_common_allot_to_window, 
     119      { 
     120        asynchronous:   true, 
     121        evalScripts:    true, 
     122        onLoading:      function(request){rubricks.common.rubricks_wait_message_open();} 
     123      } 
     124    ); 
     125  }, 
    69126  index_delete: function() { 
    70127    new Ajax.Request( 
    71128      this.url_index_delete, 
    72129      { 
    73         asynchronous:true, 
    74         evalScripts:true, 
    75         parameters:{id:this.delete_target}, 
    76         onLoaded:function(request){rubricks.common.rubricks_wait_message_close();}, 
    77         onLoading:function(request){rubricks.common.rubricks_wait_message_open();} 
     130        asynchronous:   true, 
     131        evalScripts:    true, 
     132        parameters:     {id:this.delete_target}, 
     133        onLoaded:       function(request){rubricks.common.rubricks_wait_message_close();}, 
     134        onLoading:      function(request){rubricks.common.rubricks_wait_message_open();} 
    78135      } 
    79136    ); 
     
    87144      this.url_index_finish, 
    88145      { 
    89         asynchronous:true, 
    90         evalScripts:true, 
    91         parameters:{id:this.finish_target}, 
    92         onLoaded:function(request){rubricks.common.rubricks_wait_message_close();}, 
    93         onLoading:function(request){rubricks.common.rubricks_wait_message_open();} 
     146        asynchronous:   true, 
     147        evalScripts:    true, 
     148        parameters:     {id:this.finish_target}, 
     149        onLoaded:       function(request){rubricks.common.rubricks_wait_message_close();}, 
     150        onLoading:      function(request){rubricks.common.rubricks_wait_message_open();} 
    94151      } 
    95152    ); 
     
    102159    rubricks.common.fire_submit('operationbar_button_print'); 
    103160    rubricks.common.rubricks_wait_message_close(); 
     161  }, 
     162  index_progress_arrow_act: function(el) { 
     163    el.src = el.src.replace(/progress_(left|right)\.gif/, 'progress_$1_active.gif'); 
     164  }, 
     165  index_progress_arrow_psv: function(el) { 
     166    el.src = el.src.replace(/progress_(left|right)_active\.gif/, 'progress_$1.gif'); 
     167  }, 
     168  index_progress_change: function(el, id, progress) { 
     169    var width = (progress / 2).toString() + 'px'; 
     170    Element.setStyle(el, {'width':width}); 
     171    progress = progress.toString(); 
     172    Element.update('todo_progress_text_' + id, progress); 
     173    el.name = progress; 
     174    this.progress_params = {id:id, progress:progress}; 
     175    this.index_progress_timer_set(); 
     176  }, 
     177  index_progress_decrease: function(id) { 
     178    var el = $('todo_progress_' + id); 
     179    var progress = parseInt(el.name, 10); 
     180    if(progress >= 10) { 
     181      this.index_progress_change(el, id, progress - 10); 
     182    } 
     183  }, 
     184  index_progress_increase: function(id) { 
     185    var el = $('todo_progress_' + id); 
     186    var progress = parseInt(el.name, 10); 
     187    if(progress >= 90) { 
     188      this.index_finish_confirm(id); 
     189    } else { 
     190      this.index_progress_change(el, id, progress + 10); 
     191    } 
     192  }, 
     193  index_progress_post: function() { 
     194    rubricks.todo_list.index_progress_timer_clear(); 
     195    new Ajax.Request( 
     196      rubricks.todo_list.url_index_change_progress, 
     197      { 
     198        asynchronous:   true, 
     199        evalScripts:    true, 
     200        parameters:     rubricks.todo_list.progress_params 
     201      } 
     202    ); 
     203  }, 
     204  index_progress_timer_clear: function() { 
     205    if(this.progress_timer) { 
     206      clearTimeout(this.progress_timer); 
     207      this.progress_timer = null; 
     208    } 
     209  }, 
     210  index_progress_timer_set: function() { 
     211    this.index_progress_timer_clear(); 
     212    this.progress_timer = setTimeout(rubricks.todo_list.index_progress_post, 1000); 
     213  }, 
     214  index_todo_category_edit_window_close: function() { 
     215    this.todo_category_edit_window.close(); 
     216  }, 
     217  index_todo_category_edit_window_open: function() { 
     218    this.todo_category_edit_window.center(); 
     219    this.todo_category_edit_window.open(); 
     220  }, 
     221  index_todo_category_edit_window_render: function(id) { 
     222    new Ajax.Updater( 
     223      'todo_category_edit_window_frame', 
     224      this.url_index_category_window, 
     225      { 
     226        asynchronous:   true, 
     227        evalScripts:    true, 
     228        parameters:     {id:id}, 
     229        onLoaded:       function(request){rubricks.common.rubricks_wait_message_close();}, 
     230        onLoading:      function(request){rubricks.common.rubricks_wait_message_open();} 
     231      } 
     232    ); 
    104233  }, 
    105234  list_add_ajax_history: function(tlt_id) { 
     
    115244      rubricks.todo_list.url_list_delete, 
    116245      { 
    117         asynchronous:true, 
    118         evalScripts:true, 
    119         parameters:{delete_id:delete_id_str}, 
    120         onLoaded:function(request){rubricks.common.rubricks_wait_message_close();}, 
    121         onLoading:function(request){rubricks.common.rubricks_wait_message_open();} 
     246        asynchronous:   true, 
     247        evalScripts:    true, 
     248        parameters:     {delete_id:delete_id_str}, 
     249        onLoaded:       function(request){rubricks.common.rubricks_wait_message_close();}, 
     250        onLoading:      function(request){rubricks.common.rubricks_wait_message_open();} 
    122251      } 
    123252    ); 
     
    143272  }, 
    144273  list_detail_edit_mode: function() { 
     274    $('todo_edit_form').reset(); 
     275    var el = $('todo_edit_allot_to'); 
     276    if(el) { 
     277      el.value = this.list_todo_edit_allot_to_value; 
     278    } 
    145279    rubricks.common.FormEditor.editMode('todo_info_management_area'); 
    146280    this.list_input_toggle_reminder(); 
     
    259393              rubricks.todo_list.url_list_show, 
    260394              { 
    261                 asynchronous:true, 
    262                 evalScripts:true, 
    263                 parameters:{id:tlt_id}, 
    264                 onLoaded:function(request){rubricks.common.rubricks_wait_message_close();}, 
    265                 onLoading:function(request){rubricks.common.rubricks_wait_message_open();} 
     395                asynchronous:   true, 
     396                evalScripts:    true, 
     397                parameters:     {id:tlt_id}, 
     398                onLoaded:       function(request){rubricks.common.rubricks_wait_message_close();}, 
     399                onLoading:      function(request){rubricks.common.rubricks_wait_message_open();} 
    266400              } 
    267401            ); 
  • components/todo_list/trunk/todo_list/_install/javascripts/todo.js

    r5721 r5761  
    55rubricks.common.FormEditor.readMode("todo_edit_area","todo_edit_form"); 
    66this.admin_toggle_reminder_flag(); 
     7},admin_print:function(){ 
     8rubricks.common.fire_submit("todo_list_admin_print_form","print_button"); 
     9rubricks.common.rubricks_wait_message_close(); 
    710},admin_toggle_reminder_flag:function(){ 
    811if($("todo_config_site_reminder_flag_use").checked==true){ 
     
    4851rubricks.common.rubricks_wait_message_open(); 
    4952}}); 
     53},common_todo_allot_to_clear:function(){ 
     54var el; 
     55el=$("todo_allot_to"); 
     56if(el){ 
     57el.value=""; 
     58$("todo_allot_to_display").value=""; 
     59} 
     60el=$("todo_edit_allot_to"); 
     61if(el){ 
     62el.value=""; 
     63$("todo_edit_allot_to_display").value=""; 
     64} 
     65},common_todo_allot_to_set:function(_b){ 
     66if(_b){ 
     67var el; 
     68el=$("todo_allot_to"); 
     69if(el){ 
     70el.value=_b.id; 
     71$("todo_allot_to_display").value=_b.name.unescapeHTML(); 
     72} 
     73el=$("todo_edit_allot_to"); 
     74if(el){ 
     75el.value=_b.id; 
     76$("todo_edit_allot_to_display").value=_b.name.unescapeHTML(); 
     77} 
     78}else{ 
     79this.common_todo_allot_to_clear(); 
     80} 
     81},common_todo_allot_to_window_close:function(){ 
     82this.todo_allot_to_window.close(); 
     83},common_todo_allot_to_window_open:function(){ 
     84if(this.flg_todo_allot_to_window_loaded){ 
     85this.rollover(); 
     86this.todo_allot_to_window.center(); 
     87this.todo_allot_to_window.open(); 
     88}else{ 
     89this.common_todo_allot_to_window_render(); 
     90} 
     91},common_todo_allot_to_window_render:function(){ 
     92new Ajax.Updater("todo_allot_to_window_frame",rubricks.todo_list.url_common_allot_to_window,{asynchronous:true,evalScripts:true,onLoading:function(_d){ 
     93rubricks.common.rubricks_wait_message_open(); 
     94}}); 
    5095},index_delete:function(){ 
    51 new Ajax.Request(this.url_index_delete,{asynchronous:true,evalScripts:true,parameters:{id:this.delete_target},onLoaded:function(_a){ 
    52 rubricks.common.rubricks_wait_message_close(); 
    53 },onLoading:function(_b){ 
     96new Ajax.Request(this.url_index_delete,{asynchronous:true,evalScripts:true,parameters:{id:this.delete_target},onLoaded:function(_e){ 
     97rubricks.common.rubricks_wait_message_close(); 
     98},onLoading:function(_f){ 
    5499rubricks.common.rubricks_wait_message_open(); 
    55100}}); 
     
    60105}); 
    61106},index_finish:function(){ 
    62 new Ajax.Request(this.url_index_finish,{asynchronous:true,evalScripts:true,parameters:{id:this.finish_target},onLoaded:function(_d){ 
    63 rubricks.common.rubricks_wait_message_close(); 
    64 },onLoading:function(_e){ 
     107new Ajax.Request(this.url_index_finish,{asynchronous:true,evalScripts:true,parameters:{id:this.finish_target},onLoaded:function(_11){ 
     108rubricks.common.rubricks_wait_message_close(); 
     109},onLoading:function(_12){ 
    65110rubricks.common.rubricks_wait_message_open(); 
    66111}}); 
     
    73118rubricks.common.fire_submit("operationbar_button_print"); 
    74119rubricks.common.rubricks_wait_message_close(); 
    75 },list_add_ajax_history:function(_10){ 
    76 if(AjaxHistoryPageManager.getSpecifiedValue(this._ajax_history_prefix)==_10){ 
    77 this.list_show_todo_info(_10); 
    78 }else{ 
    79 AjaxHistory.add(_10,{prefix:this._ajax_history_prefix}); 
     120},index_progress_arrow_act:function(el){ 
     121el.src=el.src.replace(/progress_(left|right)\.gif/,"progress_$1_active.gif"); 
     122},index_progress_arrow_psv:function(el){ 
     123el.src=el.src.replace(/progress_(left|right)_active\.gif/,"progress_$1.gif"); 
     124},index_progress_change:function(el,id,_18){ 
     125var _19=(_18/2).toString()+"px"; 
     126Element.setStyle(el,{"width":_19}); 
     127_18=_18.toString(); 
     128Element.update("todo_progress_text_"+id,_18); 
     129el.name=_18; 
     130this.progress_params={id:id,progress:_18}; 
     131this.index_progress_timer_set(); 
     132},index_progress_decrease:function(id){ 
     133var el=$("todo_progress_"+id); 
     134var _1c=parseInt(el.name,10); 
     135if(_1c>=10){ 
     136this.index_progress_change(el,id,_1c-10); 
     137
     138},index_progress_increase:function(id){ 
     139var el=$("todo_progress_"+id); 
     140var _1f=parseInt(el.name,10); 
     141if(_1f>=90){ 
     142this.index_finish_confirm(id); 
     143}else{ 
     144this.index_progress_change(el,id,_1f+10); 
     145
     146},index_progress_post:function(){ 
     147rubricks.todo_list.index_progress_timer_clear(); 
     148new Ajax.Request(rubricks.todo_list.url_index_change_progress,{asynchronous:true,evalScripts:true,parameters:rubricks.todo_list.progress_params}); 
     149},index_progress_timer_clear:function(){ 
     150if(this.progress_timer){ 
     151clearTimeout(this.progress_timer); 
     152this.progress_timer=null; 
     153
     154},index_progress_timer_set:function(){ 
     155this.index_progress_timer_clear(); 
     156this.progress_timer=setTimeout(rubricks.todo_list.index_progress_post,1000); 
     157},index_todo_category_edit_window_close:function(){ 
     158this.todo_category_edit_window.close(); 
     159},index_todo_category_edit_window_open:function(){ 
     160this.todo_category_edit_window.center(); 
     161this.todo_category_edit_window.open(); 
     162},index_todo_category_edit_window_render:function(id){ 
     163new Ajax.Updater("todo_category_edit_window_frame",this.url_index_category_window,{asynchronous:true,evalScripts:true,parameters:{id:id},onLoaded:function(_21){ 
     164rubricks.common.rubricks_wait_message_close(); 
     165},onLoading:function(_22){ 
     166rubricks.common.rubricks_wait_message_open(); 
     167}}); 
     168},list_add_ajax_history:function(_23){ 
     169if(AjaxHistoryPageManager.getSpecifiedValue(this._ajax_history_prefix)==_23){ 
     170this.list_show_todo_info(_23); 
     171}else{ 
     172AjaxHistory.add(_23,{prefix:this._ajax_history_prefix}); 
    80173} 
    81174},list_delete:function(id){ 
    82 var _12=id||this.delete_id_str; 
    83 new Ajax.Request(rubricks.todo_list.url_list_delete,{asynchronous:true,evalScripts:true,parameters:{delete_id:_12},onLoaded:function(_13){ 
    84 rubricks.common.rubricks_wait_message_close(); 
    85 },onLoading:function(_14){ 
    86 rubricks.common.rubricks_wait_message_open(); 
    87 }}); 
    88 },list_delete_confirm:function(_15){ 
     175var _25=id||this.delete_id_str; 
     176new Ajax.Request(rubricks.todo_list.url_list_delete,{asynchronous:true,evalScripts:true,parameters:{delete_id:_25},onLoaded:function(_26){ 
     177rubricks.common.rubricks_wait_message_close(); 
     178},onLoading:function(_27){ 
     179rubricks.common.rubricks_wait_message_open(); 
     180}}); 
     181},list_delete_confirm:function(_28){ 
    89182rubricks.common.rubricks_confirm_window_open(this.msg_delete_confirm,function(){ 
    90 rubricks.todo_list.list_delete(_15); 
     183rubricks.todo_list.list_delete(_28); 
    91184}); 
    92185},list_delete_multiple:function(){ 
     
    106199Element.show("todo_info"); 
    107200},list_detail_edit_mode:function(){ 
     201$("todo_edit_form").reset(); 
     202var el=$("todo_edit_allot_to"); 
     203if(el){ 
     204el.value=this.list_todo_edit_allot_to_value; 
     205} 
    108206rubricks.common.FormEditor.editMode("todo_info_management_area"); 
    109207this.list_input_toggle_reminder(); 
     
    133231rubricks.common.Validator.refresh_by_id("todo_edit_start_on"); 
    134232},list_input_toggle_reminder:function(){ 
    135 var _16=$("todo_edit_reminder_flag"); 
    136 if(_16){ 
    137 var _17=$("todo_edit_close_on"); 
    138 var _18=$("todo_edit_close_on_msg"); 
    139 var _19=$("todo_edit_reminder_delay"); 
    140 var _1a=$("todo_edit_reminder_every"); 
    141 if(_17.value!=""&&_18.innerHTML.match(/icon_accept/)){ 
    142 _16.disabled=false; 
    143 _19.disabled=(!_16.checked); 
    144 _1a.disabled=(!_16.checked); 
    145 }else{ 
    146 _16.disabled=true; 
    147 _19.disabled=true; 
    148 _1a.disabled=true; 
     233var _2a=$("todo_edit_reminder_flag"); 
     234if(_2a){ 
     235var _2b=$("todo_edit_close_on"); 
     236var _2c=$("todo_edit_close_on_msg"); 
     237var _2d=$("todo_edit_reminder_delay"); 
     238var _2e=$("todo_edit_reminder_every"); 
     239if(_2b.value!=""&&_2c.innerHTML.match(/icon_accept/)){ 
     240_2a.disabled=false; 
     241_2d.disabled=(!_2a.checked); 
     242_2e.disabled=(!_2a.checked); 
     243}else{ 
     244_2a.disabled=true; 
     245_2d.disabled=true; 
     246_2e.disabled=true; 
    149247} 
    150248} 
     
    187285} 
    188286this.list_select_buttons_singular(); 
    189 },list_show_todo_info:function(_1c){ 
    190 this.temp_hash=_1c
     287},list_show_todo_info:function(_30){ 
     288this.temp_hash=_30
    191289rubricks.common.execute_if_loaded("todo_scripts",function(){ 
    192 var _1d=rubricks.todo_list.temp_hash; 
    193 var _1e=rubricks.todo_list.todo_list; 
    194 if(_1e){ 
    195 var _1f=_1e.getSelected(); 
    196 if(_1f[0]!=_1d){ 
    197 rubricks.todo_list.todo_list.selectEffect(rubricks.todo_list.todo_list.buildTrId(_1d)); 
    198 } 
    199 if(_1d.length>0){ 
    200 new Ajax.Updater("todo_info",rubricks.todo_list.url_list_show,{asynchronous:true,evalScripts:true,parameters:{id:_1d},onLoaded:function(_20){ 
    201 rubricks.common.rubricks_wait_message_close(); 
    202 },onLoading:function(_21){ 
     290var _31=rubricks.todo_list.temp_hash; 
     291var _32=rubricks.todo_list.todo_list; 
     292if(_32){ 
     293var _33=_32.getSelected(); 
     294if(_33[0]!=_31){ 
     295rubricks.todo_list.todo_list.selectEffect(rubricks.todo_list.todo_list.buildTrId(_31)); 
     296} 
     297if(_31.length>0){ 
     298new Ajax.Updater("todo_info",rubricks.todo_list.url_list_show,{asynchronous:true,evalScripts:true,parameters:{id:_31},onLoaded:function(_34){ 
     299rubricks.common.rubricks_wait_message_close(); 
     300},onLoading:function(_35){ 
    203301rubricks.common.rubricks_wait_message_open(); 
    204302}}); 
     
    209307}); 
    210308}}); 
    211 AjaxHistory.addCallback(function(_22){ 
    212 rubricks.todo_list.list_show_todo_info(_22); 
     309AjaxHistory.addCallback(function(_36){ 
     310rubricks.todo_list.list_show_todo_info(_36); 
    213311},rubricks.todo_list._ajax_history_prefix); 
    214312 
  • components/todo_list/trunk/todo_list/_install/stylesheets/todo.css

    r5740 r5761  
    2323  width:                        100%; 
    2424} 
     25th.todo_category_box_title { 
     26  height:                       16px; 
     27  padding:                      4px 0 3px; 
     28} 
    2529div.todo_tile { 
    2630  border-style:                 solid; 
     
    2933  padding:                      3px; 
    3034  text-align:                   left; 
    31   width:                        95%; 
    3235} 
    3336table.todo_tile { 
     
    4447  width:                        75px; 
    4548} 
     49div.todo_tile_bg_shared { 
     50  background-color:             #dbedf8; 
     51  background-image:             none; 
     52} 
     53.todo_tile_dummy { 
     54  border:                       none; 
     55  height:                       0px; 
     56} 
    4657div.todo_tile_priority_1 { 
    4758  border-right:                 5px solid #66cc00; 
     
    5465} 
    5566 
    56 /*--[Settings for Progress Bar]-------*/ 
    57 .todo_progress { 
    58   font-size:                    1px; 
    59   height:                       10px; 
    60   padding:                      0; 
     67/*--[Settings for Block]--------------*/ 
     68dl.todo_block_list dt { 
     69  clear:                        left; 
     70  float:                        left; 
     71  margin-left:                  -6px; 
     72  width:                        18px; 
    6173} 
    62 .todo_progress_done
    63   background-color:             #3366ff
     74dl.todo_block_list dd
     75  margin-left:                  18px
    6476} 
    65 .todo_progress_print { 
    66   border:                       solid 1px black; 
     77*html dl.todo_block_list dt { 
     78  clear:                        left; 
     79  float:                        left; 
     80  margin-left:                  0; 
     81  width:                        16px; 
    6782} 
    68 .todo_progress_unfinished { 
    69   background-color:             #bbbbff
     83*html dl.todo_block_list dd { 
     84  margin-left:                  24px
    7085} 
  • components/todo_list/trunk/todo_list/admin/_main_read_content.rhtml

    r5721 r5761  
    11<% render_detail('00', hl('[_TodoList_Common_TodoConfig]')) do %> 
    2   <% render_float_button('float_button_area_read') do %> 
    3     <div id="todo_admin_edit_mode_form" class="float_button_right_inactive swap"> 
    4       <span id="todo_admin_edit_mode_button" class="buttons icon_edit" onclick="rubricks.todo_list.admin_change_edit_mode();"><%= hl('[_Common_Edit]') %></span> 
    5     </div> 
     2  <% unless print? %> 
     3    <% render_float_button('float_button_area_read') do %> 
     4      <div id="todo_admin_edit_mode_form" class="float_button_right_inactive swap"> 
     5        <span id="todo_admin_edit_mode_button" class="buttons icon_edit" onclick="rubricks.todo_list.admin_change_edit_mode();"><%= hl('[_Common_Edit]') %></span> 
     6      </div> 
     7    <% end %> 
    68  <% end %> 
    79  <table class="rubricks_general_table"> 
  • components/todo_list/trunk/todo_list/admin/main.rhtml

    r5721 r5761  
    11<div class="rubricks_general_frame_borderless"> 
    22  <% render_operation_bar do %> 
     3    <%= form_tag({:controller => '/todo_list/admin', :action => 'print', :print_action => 'print_content'}, {:id => 'todo_list_admin_print_form', :class => 'operationbar_button_right_inactive swap',  :target => "_blank"}) %> 
     4      <span id="print_button" class="buttons darkicon_print textcolor_white" onclick="rubricks.todo_list.admin_print();"><%= hl('[_Common_Print]') %></span> 
     5    </form> 
    36  <% end %> 
    47  <% render_content_body do %> 
     
    1922  rubricks.todo_list.admin_toggle_reminder_flag(); 
    2023</script> 
    21 <%= flash_for_feedback_msg(:todo_common) %> 
     24<%= flash_for_feedback_msg(:todo_message) %> 
  • components/todo_list/trunk/todo_list/admin_controller.rb

    r5721 r5761  
    88  end 
    99 
     10  def print_content 
     11    @tlc = TodoList::TodoListConfig.instance 
     12    render :partial => '/todo_list/admin/main_read_content' 
     13  end 
     14 
    1015  def update 
    1116    begin 
    1217      ActiveRecord::Base.transaction do 
    1318        @tlc = TodoList::TodoListConfig.instance 
    14         @tlc.update_attributes({ 
     19        @tlc.update_attributes!({ 
    1520          :site_reminder_flag   => params[:todo_config][:site_reminder_flag], 
    1621          :site_remind_hour     => params[:todo_config][:site_remind_hour], 
     
    2227      logger.error(ex.message) 
    2328      logger.error(ex.backtrace.join("\n  ")) 
    24       flash[:todo_update_error] = '[_TodoList_Admin_ErrorUpdate]' 
     29      raise RubricksError::Common::AjaxError, '[_TodoList_Admin_ErrorUpdate]' 
    2530    end 
    26     flash[:todo_update_message] = '[_TodoList_Admin_MessageUpdate]' 
     31    flash[:todo_message] = '[_TodoList_Admin_MessageUpdate]' 
    2732    rubricks_logger(:action_type => :update, :data => @tlc) 
    2833    redirect_to :action => 'main' 
  • components/todo_list/trunk/todo_list/block/list.rhtml

    r5721 r5761  
    11<% if @tlt_list.blank? %> 
     2  <div> 
     3    <%= hl('[_Common_ListMessage]', hl('[_TodoList_Common_Todo]')) %> 
     4  </div> 
    25<% else %> 
    3   <%= pagination_remote_links(@pages, {:params => {:update => 'todo_block_list_frame', :url => {:controller => '/todo_list/block', :action => 'list'}}, :window_size => 3}, {:id => 'todo_list_block_list_navigation_top'}) %> 
    4   <% @tlt_list.each do |tlt| %> 
    5     <p class="overflow_auto"> 
    6       <%= render_todo_deadline_mark(tlt) %><%= link_to_function(hl(tlt.title), "rubricks.todo_list.common_input_window_render(#{tlt.id}, '/todo_list/block');") %> 
    7     </p> 
    8   <% end %> 
     6  <dl class="todo_block_list"> 
     7    <% @tlt_list.each do |tlt| %> 
     8      <dt><%= render_todo_deadline_mark(tlt) %></dt> 
     9      <dd> 
     10        <div class="overflow_auto"> 
     11          <%= link_to_function(hl(tlt.title), "rubricks.todo_list.common_input_window_render(#{tlt.id}, '/todo_list/block');") %> 
     12        </div> 
     13      </dd> 
     14    <% end %> 
     15  </dl> 
    916  <%= pagination_remote_links(@pages, {:params => {:update => 'todo_block_list_frame', :url => {:controller => '/todo_list/block', :action => 'list'}}, :window_size => 3}, {:id => 'todo_list_block_list_navigation_bottom'}) %> 
    1017<% end %> 
  • components/todo_list/trunk/todo_list/block/update.rjs

    r5721 r5761  
    1 if flash[:todo_update_error] 
    2   js = %Q|rubricks.common.rubricks_message_window_open("#{hl(flash[:todo_update_error])}", 'error');| 
    3   flash[:todo_update_error] = nil 
    4 else 
    5   js = <<-"EOS" 
    6     Element.update('todo_block_list_frame', #{simple_render_component('/todo_list/block', 'list', {'page' => @page}).to_json}); 
    7     if($('todo_area')) { 
    8       Element.update('todo_area', #{simple_render_component('/todo_list/index', 'show', {}).to_json}); 
    9     } 
    10     rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_update_message])}"); 
    11   EOS 
    12   flash[:todo_update_message] = nil 
    13 end 
    14 page << js.compress_blank_and_linefeed 
     1page << %Q|Element.update('todo_block_list_frame', #{simple_render_component('/todo_list/block', 'list', {'page' => @page}).to_json});| 
     2page << %Q|if($('todo_area')) {Element.update('todo_area', #{simple_render_component('/todo_list/index', 'show', {}).to_json});}| 
     3page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_message])}");| 
     4flash[:todo_message] = nil 
  • components/todo_list/trunk/todo_list/block_controller.rb

    r5721 r5761  
    88  def list 
    99    tlcb_id_list = TodoList::TodoListCategoryBox.find_or_create_boxes(current_user.id).map{|tlcb| tlcb.id} 
    10     @pages, @tlt_list = paginate(:'/todo_list/todo_list_todo', :conditions => ['todo_list_category_box_id in (?) and closed_on is null', tlcb_id_list], :per_page => RubricksLib::LIST_PER_PAGE_IN_WINDOW, :order => 'id asc') 
     10    @pages, @tlt_list = paginate(:'/todo_list/todo_list_todo', :conditions => ['todo_list_category_boxes.id in (?) and todo_list_todos.closed_on is null', tlcb_id_list], :include => :todo_list_category_boxes, :per_page => RubricksLib::LIST_PER_PAGE_IN_WINDOW, :order => 'todo_list_todos.id asc') 
    1111  end 
    1212 
     
    1515    begin 
    1616      ActiveRecord::Base.transaction do 
    17         tlt = TodoList::TodoListTodo.create_or_update_todo(params[:todo]) 
     17        @tlt = TodoList::TodoListTodo.create_or_update_todo(params[:todo]) 
    1818      end 
    1919    rescue Exception => ex 
    20       logger.error(ex.message) 
    21       logger.error(ex.backtrace.join("\n  ")) 
    22       flash[:todo_update_error] = (params[:todo][:id].blank?) ? '[_TodoList_Index_ErrorCreate]' : '[_TodoList_Index_ErrorUpdate]' 
     20      if ex.is_a?(RubricksError::Common::AjaxError) 
     21        raise ex 
     22      else 
     23        logger.error(ex.message) 
     24        logger.error(ex.backtrace.join("\n  ")) 
     25        raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUpdate]' 
     26      end 
    2327    end 
    24     flash[:todo_update_message] = (params[:todo][:id].blank?) ? '[_TodoList_Index_MessageCreate]' : '[_TodoList_Index_MessageUpdate]' 
     28    rubricks_logger({:action_type => :update, :data => @tlt}) 
     29    flash[:todo_message] = (@tlt.pending_approval?) ? '[_TodoList_Common_MessageUpdatePendingApproval]' : '[_TodoList_Common_MessageUpdate]' 
    2530    headers["Content-Type"] = "text/javascript" 
    2631  end 
  • components/todo_list/trunk/todo_list/common/_todo_input_window.rhtml

    r5721 r5761  
    66      <table class="rubricks_general_table"> 
    77        <tr class="rubricks_general_table_even"> 
    8           <td style="width: 20%;"><%= hl('[_Common_Title]') %></td> 
     8          <td style="width:20%;"><%= hl('[_Common_Title]') %></td> 
    99          <%= validate 'todo_title', [{:required => true}, {:length => '1..30'}] %> 
    10           <td style="width: 80%;"> 
     10          <td style="width:80%;"> 
    1111            <%= text_field('todo', 'title', :size => 48, :maxlength => 30, :value => ((tlt.blank?) ? '' : tlt.title), :class => 'input_text_inactive focus') %> 
    1212            <div id="todo_title_msg" class="todo_validate_msg"></div> 
     
    2626          <td> 
    2727            <%= text_field('todo', 'start_on', :size => 16, :maxlength => 10, :class => 'input_text_inactive focus', :value => ((tlt.blank?) ? '' : render_todo_date(tlt.start_on))) %> 
    28             <span id="datepicker_todo_start_on_picker_form" class="icon_frame_inactive swap"><span id="datepicker_todo_start_on_picker_button" class="rubricks_icon icon_datepicker">&nbsp;</span></span><span id="datepicker_todo_start_on_picker_cancel_form" class="icon_frame_inactive swap" onclick="rubricks.todo_list.common_input_start_on_clear();"><span id="datepicker_todo_start_on_picker_cancel_button" class="rubricks_icon icon_dateclear">&nbsp;</span></span> 
     28            <span id="datepicker_todo_start_on_picker_form" class="icon_frame_inactive swap" title="<%= hl('[_Common_DatePicker]') %>"><span id="datepicker_todo_start_on_picker_button" class="rubricks_icon icon_datepicker">&nbsp;</span></span><span id="datepicker_todo_start_on_picker_cancel_form" class="icon_frame_inactive swap" title="<%= hl('[_Common_DateClear]') %>" onclick="rubricks.todo_list.common_input_start_on_clear();"><span id="datepicker_todo_start_on_picker_cancel_button" class="rubricks_icon icon_dateclear">&nbsp;</span></span> 
    2929            <div id="todo_start_on_msg" class="todo_validate_msg"></div> 
    3030            <%= rollover_swap('datepicker_todo_start_on_picker_form', 'datepicker_todo_start_on_picker_cancel_form') %> 
     
    3636          <td> 
    3737            <%= text_field('todo', 'close_on', :size => 16, :maxlength => 10, :class => 'input_text_inactive focus', :value => ((tlt.blank?) ? '' : render_todo_date(tlt.close_on))) %> 
    38             <span id="datepicker_todo_close_on_picker_form" class="icon_frame_inactive swap"><span id="datepicker_todo_close_on_picker_button" class="rubricks_icon icon_datepicker">&nbsp;</span></span><span id="datepicker_todo_close_on_picker_cancel_form" class="icon_frame_inactive swap" onclick="rubricks.todo_list.common_input_close_on_clear();"><span id="datepicker_todo_close_on_picker_cancel_button" class="rubricks_icon icon_dateclear">&nbsp;</span></span> 
     38            <span id="datepicker_todo_close_on_picker_form" class="icon_frame_inactive swap" title="<%= hl('[_Common_DatePicker]') %>"><span id="datepicker_todo_close_on_picker_button" class="rubricks_icon icon_datepicker">&nbsp;</span></span><span id="datepicker_todo_close_on_picker_cancel_form" class="icon_frame_inactive swap" title="<%= hl('[_Common_DateClear]') %>" onclick="rubricks.todo_list.common_input_close_on_clear();"><span id="datepicker_todo_close_on_picker_cancel_button" class="rubricks_icon icon_dateclear">&nbsp;</span></span> 
    3939            <div id="todo_close_on_msg" class="todo_validate_msg"></div> 
    4040            <%= rollover_swap('datepicker_todo_close_on_picker_form', 'datepicker_todo_close_on_picker_cancel_form') %> 
     
    4949          <td><%= hl('[_TodoList_Common_ThisOrder]') %></td> 
    5050          <td> 
    51             <input type="radio" id="todo_this_order_3" name="todo[this_order]" class="check" value="3" <%= (!tlt.blank? && tlt.this_order == 3) ? 'checked="checked"' : '' %> /> 
    52             <label for="todo_this_order_3"><%= hl('[_Common_OrderHigh]') %></label> 
    53             <input type="radio" id="todo_this_order_2" name="todo[this_order]" class="check" value="2" <%= (tlt.blank?  || tlt.this_order == 2) ? 'checked="checked"' : '' %> /> 
    54             <label for="todo_this_order_2"><%= hl('[_Common_OrderMiddle]') %></label> 
    55             <input type="radio" id="todo_this_order_1" name="todo[this_order]" class="check" value="1" <%= (!tlt.blank? && tlt.this_order == 1) ? 'checked="checked"' : '' %> /> 
    56             <label for="todo_this_order_1"><%= hl('[_Common_OrderLow]') %></label> 
     51            <input type="radio" id="todo_this_order_<%= TodoList::TodoListTodo::ORDER_VALUE[:high]   %>" name="todo[this_order]" class="check" value="<%= TodoList::TodoListTodo::ORDER_VALUE[:high]   %>" <%= (!tlt.blank? && tlt.this_order == TodoList::TodoListTodo::ORDER_VALUE[:high])  ? 'checked="checked"' : '' %> /> 
     52            <label for="todo_this_order_<%= TodoList::TodoListTodo::ORDER_VALUE[:high]   %>"><%= hl('[_Common_OrderHigh]')  %></label> 
     53            <input type="radio" id="todo_this_order_<%= TodoList::TodoListTodo::ORDER_VALUE[:middle] %>" name="todo[this_order]" class="check" value="<%= TodoList::TodoListTodo::ORDER_VALUE[:middle] %>" <%= (tlt.blank?  || tlt.this_order == TodoList::TodoListTodo::ORDER_VALUE[:middle]) ? 'checked="checked"' : '' %> /> 
     54            <label for="todo_this_order_<%= TodoList::TodoListTodo::ORDER_VALUE[:middle] %>"><%= hl('[_Common_OrderMiddle]') %></label> 
     55            <input type="radio" id="todo_this_order_<%= TodoList::TodoListTodo::ORDER_VALUE[:low]    %>" name="todo[this_order]" class="check" value="<%= TodoList::TodoListTodo::ORDER_VALUE[:low]    %>" <%= (!tlt.blank? && tlt.this_order == TodoList::TodoListTodo::ORDER_VALUE[:low])    ? 'checked="checked"' : '' %> /> 
     56            <label for="todo_this_order_<%= TodoList::TodoListTodo::ORDER_VALUE[:low]    %>"><%= hl('[_Common_OrderLow]')    %></label> 
    5757          </td> 
    5858        </tr> 
     
    6161          <td> 
    6262            <%= select('todo', 'progress', progress_options, {:selected => ((tlt.blank?) ? nil : tlt.progress)}) %> 
    63             <span id="todo_progress_finish_form" class="icon_frame_inactive swap" onclick="rubricks.todo_list.common_input_progress_finish();"><span id="todo_progress_finish_button" class="rubricks_icon icon_finish">&nbsp;</span></span> 
     63            <span id="todo_progress_finish_form" class="icon_frame_inactive swap" onclick="rubricks.todo_list.common_input_progress_finish();"><span id="todo_progress_finish_button" class="rubricks_icon icon_finish" title="<%= hl('[_Common_Finish]') %>">&nbsp;</span></span> 
     64            <% if @tlt && @tlt.pending_approval? %> 
     65              <% if @tlt.share_creater? %> 
     66                <span class="pointcolor_text"><%= hl('[_TodoList_Common_MessageNeedApproval]') %></span> 
     67              <% else %> 
     68                <span class="pointcolor_text"><%= hl('[_TodoList_Common_MessagePendingApproval]') %></span> 
     69              <% end %> 
     70            <% end %> 
    6471            <%= rollover_swap('todo_progress_finish_form') %> 
     72          </td> 
     73        </tr> 
     74        <tr class="rubricks_general_table_even"> 
     75          <td><%= hl('[_TodoList_Common_Allot]') %></td> 
     76          <td> 
     77            <% ru = tlt.share_worker rescue nil %> 
     78            <input type="hidden" id="todo_allot_to" name="todo[allot_to]" <%= (ru.blank?) ? '' : %Q|value="#{ru.id}"| %> /> 
     79            <input type="text" id="todo_allot_to_display" name="todo[allot_to_display]" <%= (ru.blank?) ? '' : %Q|value="#{hl(ru.name)}"| %> class="background_readonly" size="24" readonly="readonly" /> 
     80            <span id="todo_allot_to_select_button" class="icon_frame_inactive swap" title="<%= hl('[_Common_UserSelect]') %>" onclick="rubricks.todo_list.common_todo_allot_to_window_open();"><span class="rubricks_icon icon_user">&nbsp;</span></span><span id="todo_allot_to_clear_button" class="icon_frame_inactive swap" title="<%= hl('[_Common_UserSelectClear]') %>" onclick="rubricks.todo_list.common_todo_allot_to_clear();"><span class="rubricks_icon icon_user_remove">&nbsp;</span></span> 
     81            <%= rollover_swap('todo_allot_to_select_button', 'todo_allot_to_clear_button') %> 
    6582          </td> 
    6683        </tr> 
  • components/todo_list/trunk/todo_list/common_controller.rb

    r5721 r5761  
    66  end 
    77 
     8  def allot_to_window 
     9  end 
     10 
    811  def input 
    912    @tlc = TodoList::TodoListConfig.instance 
    10     @tlt = TodoList::TodoListTodo.find(params[:id]) rescue nil 
     13    if params[:id].blank? 
     14      @tlt = nil 
     15    else 
     16      @tlt = TodoList::TodoListTodo.find(params[:id]) 
     17      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUneditable]' unless @tlt.editable? 
     18    end 
    1119    @url_options = {:controller => ((params[:ctl].blank?) ? '/todo_list/index' : params[:ctl]), :action => ((params[:act].blank?) ? 'update' : params[:act])} 
    1220    headers["Content-Type"] = "text/javascript" 
  • components/todo_list/trunk/todo_list/common_helper.rb

    r5721 r5761  
    77    html  = [] 
    88    html << text_field('todo_filter', 'start_on', {:class => 'input_text_inactive focus background_readonly', :size => 10, :readonly => 'readonly'}) 
    9     html << %Q|<span id="datepicker_todo_filter_start_on_picker_form" class="icon_frame_inactive swap"><span id="datepicker_todo_filter_start_on_picker_button" class="rubricks_icon icon_datepicker">&nbsp;</span></span>| 
    10     html << %Q|<span id="datepicker_todo_filter_start_on_picker_cancel_form" class="icon_frame_inactive swap" onclick="rubricks.todo_list.list_filter_start_on_clear();"><span id="datepicker_todo_filter_start_on_picker_cancel_button" class="rubricks_icon icon_dateclear">&nbsp;</span></span>| 
     9    html << %Q|<span id="datepicker_todo_filter_start_on_picker_form" class="icon_frame_inactive swap" title="#{hl('[_Common_DatePicker]')}"><span id="datepicker_todo_filter_start_on_picker_button" class="rubricks_icon icon_datepicker">&nbsp;</span></span>| 
     10    html << %Q|<span id="datepicker_todo_filter_start_on_picker_cancel_form" class="icon_frame_inactive swap" title="#{hl('[_Common_DateClear]')}" onclick="rubricks.todo_list.list_filter_start_on_clear();"><span id="datepicker_todo_filter_start_on_picker_cancel_button" class="rubricks_icon icon_dateclear">&nbsp;</span></span>| 
    1111    html << hl('[_Common_RangeMark]') 
    1212    html << text_field('todo_filter', 'close_on', {:class => 'input_text_inactive focus background_readonly', :size => 10, :readonly => 'readonly'}) 
    13     html << %Q|<span id="datepicker_todo_filter_close_on_picker_form" class="icon_frame_inactive swap"><span id="datepicker_todo_filter_close_on_picker_button" class="rubricks_icon icon_datepicker">&nbsp;</span></span>| 
    14     html << %Q|<span id="datepicker_todo_filter_close_on_picker_cancel_form" class="icon_frame_inactive swap" onclick="rubricks.todo_list.list_filter_close_on_clear();"><span id="datepicker_todo_filter_close_on_picker_cancel_button" class="rubricks_icon icon_dateclear">&nbsp;</span></span>| 
     13    html << %Q|<span id="datepicker_todo_filter_close_on_picker_form" class="icon_frame_inactive swap" title="#{hl('[_Common_DatePicker]')}"><span id="datepicker_todo_filter_close_on_picker_button" class="rubricks_icon icon_datepicker">&nbsp;</span></span>| 
     14    html << %Q|<span id="datepicker_todo_filter_close_on_picker_cancel_form" class="icon_frame_inactive swap" title="#{hl('[_Common_DateClear]')}" onclick="rubricks.todo_list.list_filter_close_on_clear();"><span id="datepicker_todo_filter_close_on_picker_cancel_button" class="rubricks_icon icon_dateclear">&nbsp;</span></span>| 
    1515    html << rollover_swap('datepicker_todo_filter_start_on_picker_form', 'datepicker_todo_filter_start_on_picker_cancel_form', 'datepicker_todo_filter_close_on_picker_form', 'datepicker_todo_filter_close_on_picker_cancel_form') 
    1616    return html.join('') 
     
    4141  end 
    4242 
     43  def render_share_info(*args) 
     44    options = args.flex :tlt, :human_legible 
     45    case options[:tlt].share_status 
     46    when nil 
     47      if options[:human_legible].blank? 
     48        return '' 
     49      else 
     50        return RubricksLib.hl('[_TodoList_Common_NotAllotted]') 
     51      end 
     52    when TodoList::TodoListTodoLink::SHARE_CREATER 
     53      return %Q|<div>#{hl('[_TodoList_Common_AllotTo]', options[:tlt].share_worker.name)}</div>| 
     54    when TodoList::TodoListTodoLink::SHARE_MIDDLEMAN 
     55      return %Q|<div class="pointcolor_text">#{hl('[_TodoList_Common_AllotFrom]', options[:tlt].share_creater.name)}</div><div>#{hl('[_TodoList_Common_AllotTo]', options[:tlt].share_worker.name)}</div>| 
     56    when TodoList::TodoListTodoLink::SHARE_WORKER 
     57      return %Q|<div class="pointcolor_text">#{hl('[_TodoList_Common_AllotFrom]', options[:tlt].share_creater.name)}</div>| 
     58    end 
     59  end 
     60 
    4361  def render_todo(tlt) 
    4462    render :partial => '/todo_list/index/todo',  :locals => {:tlt => tlt} 
     
    4765  def render_todo_buttons(tlt) 
    4866    html  = [] 
    49     html << %Q|<span id="todo_#{tlt.id}_finish_button" class="icon_frame_inactive swap" onclick="rubricks.todo_list.index_finish_confirm(#{tlt.id});"><span class="rubricks_icon icon_finish">&nbsp;</span></span>| 
    50     html << %Q|<span id="todo_#{tlt.id}_update_button" class="icon_frame_inactive swap" onclick="rubricks.todo_list.common_input_window_render(#{tlt.id});"><span class="rubricks_icon icon_edit">&nbsp;</span></span>| 
    51     html << %Q|<span id="todo_#{tlt.id}_delete_button" class="icon_frame_inactive swap" onclick="rubricks.todo_list.index_delete_confirm(#{tlt.id});"><span class="rubricks_icon icon_delete">&nbsp;</span></span>| 
     67    html << %Q|<span id="todo_#{tlt.id}_finish_button" class="icon_frame_inactive swap" title="#{hl('[_Common_Finish]')}" onclick="rubricks.todo_list.index_finish_confirm(#{tlt.id});"><span class="rubricks_icon icon_finish">&nbsp;</span></span>| 
     68    html << %Q|<span id="todo_#{tlt.id}_update_button" class="icon_frame_inactive swap" title="#{hl('[_Common_Edit]')}"   onclick="rubricks.todo_list.common_input_window_render(#{tlt.id});"><span class="rubricks_icon icon_edit">&nbsp;</span></span>| 
     69    html << %Q|<span id="todo_#{tlt.id}_delete_button" class="icon_frame_inactive swap" title="#{hl('[_Common_Delete]')}" onclick="rubricks.todo_list.index_delete_confirm(#{tlt.id});"><span class="rubricks_icon icon_delete">&nbsp;</span></span>| if tlt.deletable? 
    5270    html << rollover_swap("todo_#{tlt.id}_finish_button", "todo_#{tlt.id}_update_button", "todo_#{tlt.id}_delete_button") 
    5371    return html.join('') 
    5472  end 
    5573 
    56   def render_todo_date(date) 
    57     if date.blank? 
    58       return '' 
     74  def render_todo_date(*args) 
     75    options = args.flex :date, :human_legible 
     76    if options[:date].blank? 
     77      if options[:human_legible].blank? 
     78        return '' 
     79      else 
     80        return RubricksLib.hl('[_Common_NotSpecified]') 
     81      end 
    5982    else 
    60       return date.strftime(hl('[_Common_Date_Format]')) 
     83      return options[:date].strftime(hl('[_Common_Date_Format]')) 
    6184    end 
    6285  end 
    6386 
    6487  def render_todo_deadline(tlt) 
    65     html  = [] 
    6688    distance = tlt.distance_for_close_on 
    67     unless distance.nil? 
    68       html << '<div class="float_right">' 
     89    if distance.nil? 
     90      return '' 
     91    else 
    6992      if distance > TodoList::TodoListTodo::DEADLINE_CAUTION 
    70         html << tlt.close_on.strftime(hl('[_Common_Date_Format]')) 
     93        return %Q|<div>#{tlt.close_on.strftime(hl('[_Common_Date_Format]'))}</div>| 
    7194      else 
    72         html << %Q|<span class="pointcolor_text">#{TodoList::TodoListLib.deadline_message(distance)}</span>| 
     95        return %Q|<div class="pointcolor_text">#{TodoList::TodoListLib.deadline_message(distance)}</div>| 
    7396      end 
    74       html << '</div>' 
    7597    end 
    76     return html.join('') 
    7798  end 
    7899 
     
    90111  def render_todo_order(tlt) 
    91112    case tlt.this_order 
    92     when 3 
     113    when TodoList::TodoListTodo::ORDER_VALUE[:high] 
    93114      return hl('[_Common_OrderHigh]') 
    94     when 2 
     115    when TodoList::TodoListTodo::ORDER_VALUE[:middle] 
    95116      return hl('[_Common_OrderMiddle]') 
    96     when 1 
     117    when TodoList::TodoListTodo::ORDER_VALUE[:low] 
    97118      return hl('[_Common_OrderLow]') 
    98119    end 
    99120  end 
    100121 
    101   def render_todo_progress(*args) 
    102     options = args.flex :count, :width 
     122  def render_todo_progress(tlt) 
    103123    options = { 
    104       :count => 0, 
    105       :width => 70, 
    106     }.merge(options) 
    107     done = (options[:width].to_f * options[:count].to_f / 100.0).to_i 
    108     if print? 
    109       return %Q|<div class="todo_progress todo_progress_unfinished todo_progress_print" style="width:#{options[:width]}px;"><div style="width:#{done}px;" class="todo_progress todo_progress_done"></div></div>| 
    110     else 
    111       return %Q|<div class="todo_progress todo_progress_unfinished" style="width:#{options[:width]}px;"><div style="width:#{done}px;" class="todo_progress todo_progress_done"></div></div>| 
    112     end 
     124      :arrow_width  => 12, 
     125      :height       => 15, 
     126      :width        => 74, 
     127    } 
     128    empty = options[:width] - options[:arrow_width] * 2 
     129    fill  = (empty.to_f * tlt.progress.to_f / 100.0).to_i 
     130    html  = '' 
     131    html += %Q|<img #{                                                } src="#{image_path('/images/components/todo_list/progress_left.gif')}"  #{(print?) ? '' : %Q|onclick="rubricks.todo_list.index_progress_decrease(#{tlt.id});" ondblclick="Event.stop(event);" onmouseover="rubricks.todo_list.index_progress_arrow_act(this);" onmouseout="rubricks.todo_list.index_progress_arrow_psv(this);"|} style="#{(print?) ? '' : 'cursor:pointer;'} height:#{options[:height]}px; #{               } width:#{options[:arrow_width]}px;">| 
     132    html += %Q|<img id="todo_progress_#{tlt.id}" name="#{tlt.progress}" src="#{image_path('/images/components/todo_list/progress_fill.gif')}"  #{                                                                                                                                                                                                                                                     } style="#{                                 } height:#{options[:height]}px; position:absolute; width:#{fill}px;">| 
     133    html += %Q|<img #{                                                } src="#{image_path('/images/components/todo_list/progress_empty.gif')}" #{                                                                                                                                                                                                                                                     } style="#{                                 } height:#{options[:height]}px; #{               } width:#{empty}px;">| 
     134    html += %Q|<img #{                                                } src="#{image_path('/images/components/todo_list/progress_right.gif')}" #{(print?) ? '' : %Q|onclick="rubricks.todo_list.index_progress_increase(#{tlt.id});" ondblclick="Event.stop(event);" onmouseover="rubricks.todo_list.index_progress_arrow_act(this);" onmouseout="rubricks.todo_list.index_progress_arrow_psv(this);"|} style="#{(print?) ? '' : 'cursor:pointer;'} height:#{options[:height]}px; #{               } width:#{options[:arrow_width]}px;">| 
     135    return html 
    113136  end 
    114137 
  • components/todo_list/trunk/todo_list/component_plugins/calendar/init.rb

    r4142 r5761  
    11lib = File.expand_path("#{File.dirname(__FILE__)}/lib") 
    22require_dependency "#{lib}/todo_list_adapter" 
    3  
    43RubricksScheduleManager << TodoList::TodoListAdapter 
  • components/todo_list/trunk/todo_list/component_plugins/calendar/lib/todo_list_adapter.rb

    r4142 r5761  
    22  class << self 
    33    def schedules(params) 
    4       sync_todos = TodoList::TodoListTodo.find( 
    5         :all, 
    6         :conditions => [ 
    7           'sync_calendar_flag = 1 and ' + 
    8           'todo_list_category_boxes.rubricks_user_id = ? and ' + 
    9           'YEAR(close_on) = ? and MONTH(close_on) = ?', 
    10           params[:current_user].id , 
    11           params[:year], params[:month] 
    12         ], 
    13         :include => [:todo_list_category_box] 
    14       ) 
    15  
    16       sync_todos.collect do |sync_todo| 
    17         finish_time =  Time.gm( 
    18           sync_todo.close_on.year, 
    19           sync_todo.close_on.month, 
    20           sync_todo.close_on.day, 
    21           sync_todo.close_on.hour, 
    22           sync_todo.close_on.min 
    23         ) + 30.minute 
    24         finish_datetime = DateTime.new( 
    25           finish_time.year, 
    26           finish_time.month, 
    27           finish_time.day, 
    28           finish_time.hour, 
    29           finish_time.min 
    30         ) 
    31         RubricksSchedule.new( 
    32           :id => sync_todo.id, 
    33           :start => sync_todo.close_on, 
    34           :finish => finish_datetime, 
    35           :description => sync_todo.title, 
    36           :className => 'class1' 
    37         ) 
    38       end 
     4      range             = Date.new(params[:year].to_i, params[:month].to_i, 1).to_month_range 
     5      filter_conditions = TodoList::TodoListTodo.filter_merge_conditions({:start_on => range.first.strftime(RubricksLib.hl('[_Common_Date_Format]')), :close_on => range.last.strftime(RubricksLib.hl('[_Common_Date_Format]'))}) 
     6      tlt_list          = TodoList::TodoListTodo.find(:all, :conditions => filter_conditions[:conditions], :include => :todo_list_category_boxes, :order => 'todo_list_todos.id desc') 
     7      return tlt_list.map {|tlt| tlt.to_schedule} 
    398    end 
    409 
    41     def change(schedule) 
    42       target = TodoList::TodoListTodo.find(schedule.sid) 
    43       target.close_on = schedule.start 
    44       target.save 
     10    def change(rs) 
     11      TodoList::TodoListTodo.update!(rs.sid, {:close_on => rs.start}) 
    4512    end 
    4613 
  • components/todo_list/trunk/todo_list/index/_todo.rhtml

    r5722 r5761  
    1 <div id="todo_<%= tlt.id %>" class="todo_tile background_white <%= (print?) ? '' : 'cursor_move' %> rubricks_general_table_border" <%= (print?) ? '' : %Q|ondblclick="rubricks.todo_list.common_input_window_render(#{tlt.id});"| %>> 
     1<div id="todo_<%= tlt.id %>" class="todo_tile <%= (tlt.share?) ? 'todo_tile_bg_shared' : 'background_white' %> <%= (print?) ? '' : 'cursor_move' %> rubricks_general_table_border" <%= (print?) ? '' : %Q|ondblclick="rubricks.todo_list.common_input_window_render(#{tlt.id});"| %> <%= (msie?) ? 'style="width:95%;"' : '' %>> 
    22  <div class="todo_tile_priority_<%= tlt.this_order %>"> 
    33    <table class="todo_tile"> 
     4      <tr class="todo_tile_dummy"> 
     5        <td style="width:74px;"></td> 
     6        <td style="width:32px;"></td> 
     7        <td></td> 
     8      </tr> 
    49      <tr> 
    510        <% if print? %> 
    6           <td colspan="2"> 
     11          <td colspan="3"> 
    712            <div class="overflow_auto"> 
    813              <%= hl(tlt.title) %> 
     
    1015          </td> 
    1116        <% else %> 
    12           <td class="todo_tile_buttons"
     17          <td class="todo_tile_buttons" style="width:74px;"
    1318            <%= render_todo_buttons(tlt) %> 
    1419          </td> 
    15           <td class="overflow_auto"> 
     20          <td colspan="2"> 
    1621            <div class="overflow_auto"> 
    1722              <%= hl(tlt.title) %> 
     
    2227      <tr> 
    2328        <td> 
    24           <%= render_todo_progress(tlt.progress) %> 
     29          <%= render_todo_progress(tlt) %> 
    2530        </td> 
    2631        <td> 
     32          <span id="todo_progress_text_<%= tlt.id %>"><%= tlt.progress %></span>% 
     33        </td> 
     34        <td class="text_right"> 
    2735          <%= render_todo_deadline(tlt) %> 
    28           <%= tlt.progress %>% 
     36          <%= render_share_info(tlt) %> 
    2937        </td> 
    3038      </tr> 
  • components/todo_list/trunk/todo_list/index/main.rhtml

    r5722 r5761  
    11<div class="rubricks_general_frame_borderless"> 
    22  <% render_operation_bar do %> 
    3     <% form_tag({:controller => '/todo_list/index', :action => 'print', :page => 'print_content'}, {:id => 'operationbar_button_print', :class => 'operationbar_button_right_inactive swap',  :target => "_blank"}) do %> 
     3    <% form_tag({:controller => '/todo_list/index', :action => 'print', :print_action => 'print_content'}, {:id => 'operationbar_button_print', :class => 'operationbar_button_right_inactive swap',  :target => "_blank"}) do %> 
    44      <span id="print_button" class="buttons darkicon_print textcolor_white" onclick="rubricks.todo_list.index_print();"><%= hl('[_Common_Print]') %></span> 
    55    <% end %> 
    66    <div id="operationbar_button_todo_create" class="operationbar_button_left_inactive swap"> 
    7       <span id="todo_create_window_open_button" class="buttons darkicon_new textcolor_white" onclick="rubricks.todo_list.common_input_window_render(0);"><%= hl('[_Common_New]') %></span> 
     7      <span id="todo_create_window_open_button" class="buttons darkicon_new textcolor_white" onclick="rubricks.todo_list.common_input_window_render();"><%= hl('[_Common_New]') %></span> 
    88    </div> 
    99  <% end %> 
     
    1818  <% end %> 
    1919</div> 
     20<div id="todo_category_edit_window_frame"></div> 
  • components/todo_list/trunk/todo_list/index/show.rhtml

    r5740 r5761  
    33    <tr> 
    44      <% @tlcb_list.each do |tlcb| %> 
    5         <th><%= hl(tlcb.title) %></th> 
     5        <th class="todo_category_box_title"><span id="todo_category_title_<%= tlcb.id %>"><%= hl(tlcb.title) %></span><span id="todo_category_<%= tlcb.id %>_title_edit_button" class="icon_frame_inactive swap" title="<%= hl('[_Common_Edit]') %>" onclick="rubricks.todo_list.index_todo_category_edit_window_render(<%= tlcb.id %>);"><span class="rubricks_icon icon_edit">&nbsp;</span></span></th> 
    66      <% end %> 
    77    </tr> 
     
    2121  </tbody> 
    2222</table> 
     23<% @tlcb_list.each do |tlcb| %> 
     24  <%= rollover_swap("todo_category_#{tlcb.id}_title_edit_button") %> 
     25<% end %> 
    2326<%= sortable_element('todo_category_box_3', :url => {:controller => '/todo_list/index', :action => "change_order", :params => {:box_no => 3}}, :tag => 'div', :dropOnEmpty => true, :constraint => false, :containment => ['todo_category_box_3', 'todo_category_box_2', 'todo_category_box_1']) %> 
    2427<%= sortable_element('todo_category_box_2', :url => {:controller => '/todo_list/index', :action => "change_order", :params => {:box_no => 2}}, :tag => 'div', :dropOnEmpty => true, :constraint => false, :containment => ['todo_category_box_3', 'todo_category_box_2', 'todo_category_box_1']) %> 
  • components/todo_list/trunk/todo_list/index/update.rjs

    r5722 r5761  
    1 if flash[:todo_update_error] 
    2   js = %Q|rubricks.common.rubricks_message_window_open("#{hl(flash[:todo_update_error])}", 'error');| 
    3   flash[:todo_update_error] = nil 
    4 else 
    5   js = <<-"EOS" 
    6     Element.update('todo_area', #{simple_render_component('/todo_list/index', 'show', {}).to_json}); 
    7     rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_update_message])}"); 
    8   EOS 
    9   flash[:todo_update_message] = nil 
    10 end 
    11 page << js.compress_blank_and_linefeed 
     1page << %Q|Element.update('todo_area', #{simple_render_component('/todo_list/index', 'show', {}).to_json});| 
     2page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_message])}");| 
     3flash[:todo_message] = nil 
  • components/todo_list/trunk/todo_list/index_controller.rb

    r5721 r5761  
    22  define_page 
    33  uses_component_template_root 
    4   helper :'todo_list/common' 
     4  helper        :'todo_list/common' 
     5  before_filter :refuse_guest 
    56 
    67  def main 
    78    @tlc = TodoList::TodoListConfig.instance 
    8     rubricks_logger({:action_type => :list}) 
     9  end 
     10 
     11  def category_update 
     12    begin 
     13      ActiveRecord::Base.transaction do 
     14        @tlcb = TodoList::TodoListCategoryBox.update!(params[:id], {:title => params[:todo_category][:title]}) 
     15        flash[:todo_message] = '[_TodoList_Common_MessageCategoryUpdate]' 
     16      end 
     17    rescue Exception => ex 
     18      logger.error(ex.message) 
     19      logger.error(ex.backtrace.join("\n  ")) 
     20      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorCategoryUpdate]' 
     21    end 
     22  end 
     23 
     24  def category_window 
     25    @tlcb = TodoList::TodoListCategoryBox.find(params[:id]) 
    926  end 
    1027 
     
    1734      logger.error(ex.message) 
    1835      logger.error(ex.backtrace.join("\n  ")) 
    19       raise ex 
     36      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUpdate]' 
     37    end 
     38    render :nothing => true 
     39  end 
     40 
     41  def change_progress 
     42    begin 
     43      ActiveRecord::Base.transaction do 
     44        TodoList::TodoListTodo.progress(params[:id].to_i, params[:progress].to_i) 
     45      end 
     46    rescue Exception => ex 
     47      logger.error(ex.message) 
     48      logger.error(ex.backtrace.join("\n  ")) 
     49      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUpdate]' 
    2050    end 
    2151    render :nothing => true 
     
    3262      logger.error(ex.message) 
    3363      logger.error(ex.backtrace.join("\n  ")) 
    34       flash[:todo_update_error] = '[_TodoList_Common_ErrorDelete]' 
     64      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorDelete]' 
    3565    end 
    36     flash[:todo_update_message] = '[_TodoList_Common_MessageDelete]' 
     66    flash[:todo_message] = '[_TodoList_Common_MessageDelete]' 
    3767    headers["Content-Type"] = "text/javascript" 
    3868    render :template => '/todo_list/index/update.rjs' 
     
    4777      logger.error(ex.message) 
    4878      logger.error(ex.backtrace.join("\n  ")) 
    49       flash[:todo_update_error] = '[_TodoList_Common_ErrorUpdate]' 
     79      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUpdate]' 
    5080    end 
    5181    rubricks_logger({:action_type => :update, :data => @tlt}) 
    52     flash[:todo_update_message] = '[_TodoList_Common_MessageUpdate]' 
     82    flash[:todo_message] = (@tlt.pending_approval?) ? '[_TodoList_Common_MessageUpdatePendingApproval]' : '[_TodoList_Common_MessageUpdate]' 
    5383    headers["Content-Type"] = "text/javascript" 
    5484    render :template => '/todo_list/index/update.rjs' 
     
    5686 
    5787  def print_content 
    58     @tlcb_list = TodoList::TodoListCategoryBox.find_or_create_boxes(current_user.id
     88    @tlcb_list = TodoList::TodoListCategoryBox.find_or_create_boxes(current_user.id, {:with_task => true}
    5989  end 
    6090 
    6191  def show 
    62     @tlcb_list = TodoList::TodoListCategoryBox.find_or_create_boxes(current_user.id) 
     92    @tlcb_list = TodoList::TodoListCategoryBox.find_or_create_boxes(current_user.id, {:with_task => true}) 
     93    rubricks_logger({:action_type => :list}) 
    6394  end 
    6495 
    6596  def update 
    6697    begin 
     98      flash[:todo_message] = '[_TodoList_Common_MessageCreate]' if params[:todo][:id].blank? 
    6799      ActiveRecord::Base.transaction do 
    68100        @tlt = TodoList::TodoListTodo.create_or_update_todo(params[:todo]) 
    69101      end 
    70102    rescue Exception => ex 
    71       logger.error(ex.message) 
    72       logger.error(ex.backtrace.join("\n  ")) 
    73       flash[:todo_update_error] = (params[:todo][:id].blank?) ? '[_TodoList_Common_ErrorCreate]' : '[_TodoList_Common_ErrorUpdate]' 
     103      if ex.is_a?(RubricksError::Common::AjaxError) 
     104        raise ex 
     105      else 
     106        logger.error(ex.message) 
     107        logger.error(ex.backtrace.join("\n  ")) 
     108        error_message = (params[:todo][:id].blank?) ? '[_TodoList_Common_ErrorCreate]' : '[_TodoList_Common_ErrorUpdate]' 
     109        raise RubricksError::Common::AjaxError, error_message 
     110      end 
    74111    end 
    75112    rubricks_logger({:action_type => :update, :data => @tlt}) 
    76     flash[:todo_update_message] = (params[:todo][:id].blank?) ? '[_TodoList_Common_MessageCreate]' : '[_TodoList_Common_MessageUpdate]' 
     113    flash[:todo_message] ||= (@tlt.pending_approval?) ? '[_TodoList_Common_MessageUpdatePendingApproval]' : '[_TodoList_Common_MessageUpdate]' 
    77114    headers["Content-Type"] = "text/javascript" 
    78115    render :template => '/todo_list/index/update.rjs' 
  • components/todo_list/trunk/todo_list/languages/english.rb

    r5721 r5761  
    55      '_TodoList_Admin_MessageUpdate'                           => 'todo configs are updated.', 
    66      '_TodoList_Admin_RemindTime'                              => 'Remind Time', 
     7      '_TodoList_Common_Allot'                                  => 'Allot the task', 
     8      '_TodoList_Common_AllotFrom'                              => 'This task is allotted from %s.', 
     9      '_TodoList_Common_AllotTo'                                => 'This task is allotted to %s.', 
     10      '_TodoList_Common_CategoryWindowTitle'                    => 'Edit Category Title', 
    711      '_TodoList_Common_CloseOn'                                => 'Closing date', 
    812      '_TodoList_Common_DeadlineAfter'                          => '%d day(s) after', 
    913      '_TodoList_Common_DeadlineBefore'                         => '%d day(s) before', 
    1014      '_TodoList_Common_DeadlineJust'                           => 'Today', 
     15      '_TodoList_Common_ErrorAllotToCreator'                    => 'You can not allot the task to task-owner.', 
     16      '_TodoList_Common_ErrorCategoryUpdate'                    => 'Failed to update a title of the category.', 
    1117      '_TodoList_Common_ErrorCreate'                            => 'Failed to create the task.', 
    1218      '_TodoList_Common_ErrorDelete'                            => 'Failed to delete the task.', 
     19      '_TodoList_Common_ErrorReturnByOther'                     => 'You can not return the tast because you are not owner of it.', 
    1320      '_TodoList_Common_ErrorTodoNotSelected'                   => 'Any task is not selected.', 
     21      '_TodoList_Common_ErrorUneditable'                        => 'Failed to access the task. Please refresh the screen and try again.', 
    1422      '_TodoList_Common_ErrorUpdate'                            => 'Failed to update the task.', 
    1523      '_TodoList_Common_InputWindowTitle'                       => 'ToDo Input Window', 
     24      '_TodoList_Common_MessageCategoryUpdate'                  => 'A title of the category is updated.', 
    1625      '_TodoList_Common_MessageCreate'                          => 'The task is created.', 
    1726      '_TodoList_Common_MessageDelete'                          => 'The task is deleted.', 
    1827      '_TodoList_Common_MessageFinishConfirm'                   => 'Are you sure to finish this task?', 
     28      '_TodoList_Common_MessageNeedApproval'                    => 'This task will be finished by save on.', 
     29      '_TodoList_Common_MessagePendingApproval'                 => 'This task will be finished by approval.', 
    1930      '_TodoList_Common_MessageRevertConfirm'                   => 'Are you sure to revert this task?', 
    2031      '_TodoList_Common_MessageUpdate'                          => 'The task is updated.', 
     32      '_TodoList_Common_MessageUpdatePendingApproval'           => 'The task is updated. It will be finished when the owner approve.', 
    2133      '_TodoList_Common_Progress'                               => 'Progress', 
    2234      '_TodoList_Common_Reminder'                               => 'Reminder', 
     
    2436      '_TodoList_Common_RemindOptionAtOnce'                     => 'At Once', 
    2537      '_TodoList_Common_RemindOptionEveryday'                   => 'Everyday', 
     38      '_TodoList_Common_SendReminder'                           => 'Send Reminder', 
    2639      '_TodoList_Common_SendReminderAtOnce'                     => 'Send remind mail at %s', 
    2740      '_TodoList_Common_SendReminderEveryday'                   => 'Send remind mail everyday from %s', 
    28       '_TodoList_Common_SendReminder'                           => 'Send Reminder', 
    2941      '_TodoList_Common_StartOn'                                => 'Starting date', 
    3042      '_TodoList_Common_ThisOrder'                              => 'Priority', 
     
    3345      '_TodoList_Common_TodoDetail'                             => 'ToDo Detail', 
    3446      '_TodoList_Common_TodoList'                               => 'ToDo List', 
    35       '_TodoList_Filter_TargetOptionAll'                        => 'All', 
     47      '_TodoList_Filter_OrderOptionAll'                         => 'Priority : All', 
     48      '_TodoList_Filter_OrderOptionHigh'                        => 'High', 
     49      '_TodoList_Filter_OrderOptionLow'                         => 'Low', 
     50      '_TodoList_Filter_OrderOptionMiddle'                      => 'Middle', 
     51      '_TodoList_Filter_TargetOptionAll'                        => 'Target : All', 
    3652      '_TodoList_Filter_TargetOptionCompleted'                  => 'Completed', 
    3753      '_TodoList_Filter_TargetOptionUncompleted'                => 'Uncompleted', 
  • components/todo_list/trunk/todo_list/languages/japanese.rb

    r5721 r5761  
    22  def define_lang 
    33    lang('japanese').merge!({ 
    4       '_TodoList_Admin_ErrorUpdate'                             => 'Todo蚭定の曎新に倱敗したした。', 
    5       '_TodoList_Admin_MessageUpdate'                           => 'Todo蚭定を曎新したした。', 
     4      '_TodoList_Admin_ErrorUpdate'                             => 'ToDo蚭定の曎新に倱敗したした。', 
     5      '_TodoList_Admin_MessageUpdate'                           => 'ToDo蚭定を曎新したした。', 
    66      '_TodoList_Admin_RemindTime'                              => 'リマむンドメヌル送信時刻', 
     7      '_TodoList_Common_Allot'                                  => '割圓', 
     8      '_TodoList_Common_AllotFrom'                              => '「%s」から割圓', 
     9      '_TodoList_Common_AllotTo'                                => '「%s」に割圓', 
     10      '_TodoList_Common_CategoryWindowTitle'                    => 'カテゎリ名線集', 
    711      '_TodoList_Common_CloseOn'                                => '完了予定日', 
    812      '_TodoList_Common_DeadlineAfter'                          => '締切%d日趠
     
    1014      '_TodoList_Common_DeadlineBefore'                         => '締切%d日前', 
    1115      '_TodoList_Common_DeadlineJust'                           => '本日締切', 
     16      '_TodoList_Common_ErrorAllotToCreator'                    => 'ToDoを䜜成耠
     17自身に割圓するこずはできたせん。', 
     18      '_TodoList_Common_ErrorCategoryUpdate'                    => 'カテゎリ名の曎新に倱敗したした。', 
    1219      '_TodoList_Common_ErrorCreate'                            => 'ToDoの新芏䜜成に倱敗したした。', 
    1320      '_TodoList_Common_ErrorDelete'                            => 'ToDoの削陀に倱敗したした。', 
     21      '_TodoList_Common_ErrorReturnByOther'                     => 'ToDo䜜成耠
     22以倖が差し戻すこずはできたせん。', 
    1423      '_TodoList_Common_ErrorTodoNotSelected'                   => 'ToDoが遞択されおいたせん。', 
     24      '_TodoList_Common_ErrorUneditable'                        => '指定されたToDoを参ç 
     25§ã™ã‚‹ã“ずができたせん。該圓ToDoの閲芧・曎新暩限がなくなった可胜性がありたす。画面を曎新しおやり盎しおください。', 
    1526      '_TodoList_Common_ErrorUpdate'                            => 'ToDoの曎新に倱敗したした。', 
    1627      '_TodoList_Common_InputWindowTitle'                       => 'ToDoå 
    1728¥åŠ›ç”»é¢', 
     29      '_TodoList_Common_MessageCategoryUpdate'                  => 'カテゎリ名を曎新したした。', 
    1830      '_TodoList_Common_MessageCreate'                          => 'ToDoを新芏䜜成したした。', 
    1931      '_TodoList_Common_MessageDelete'                          => 'ToDoを削陀したした。', 
    2032      '_TodoList_Common_MessageFinishConfirm'                   => 'タスクを完了(進捗率100%)にしたす。よろしいですか', 
     33      '_TodoList_Common_MessageNeedApproval'                    => '※ このたた保存するこずで完了ずなりたす。', 
     34      '_TodoList_Common_MessagePendingApproval'                 => '※ ToDo䜜成耠
     35の承認埌、完了ずなりたす。', 
    2136      '_TodoList_Common_MessageRevertConfirm'                   => 'タスクを未完了(進捗率90%)にしたす。よろしいですか', 
    2237      '_TodoList_Common_MessageUpdate'                          => 'ToDoを曎新したした。', 
     38      '_TodoList_Common_MessageUpdatePendingApproval'           => 'ToDoを曎新したした。ToDo䜜成耠
     39の承認埌、完了ずなりたす。', 
     40      '_TodoList_Common_NotAllotted'                            => '未割圓', 
    2341      '_TodoList_Common_Progress'                               => '進捗率', 
    2442      '_TodoList_Common_Reminder'                               => 'ToDoリマむンダ', 
     
    3654      '_TodoList_Common_TodoDetail'                             => 'ToDo詳现', 
    3755      '_TodoList_Common_TodoList'                               => 'ToDo䞀芧', 
    38       '_TodoList_Filter_TargetOptionAll'                        => 'å 
    39 šãŠ', 
     56      '_TodoList_Filter_OrderOptionAll'                         => 'å 
     57šãŠã®å„ªå 
     58ˆåºŠ', 
     59      '_TodoList_Filter_OrderOptionHigh'                        => '優å 
     60ˆåºŠïŒšé«˜', 
     61      '_TodoList_Filter_OrderOptionLow'                         => '優å 
     62ˆåºŠïŒšäœŽ', 
     63      '_TodoList_Filter_OrderOptionMiddle'                      => '優å 
     64ˆåºŠïŒšäž­', 
     65      '_TodoList_Filter_TargetOptionAll'                        => '完了・未完了', 
    4066      '_TodoList_Filter_TargetOptionCompleted'                  => '完了のみ', 
    4167      '_TodoList_Filter_TargetOptionUncompleted'                => '未完了のみ', 
     
    4470ちタスク', 
    4571      '_TodoList_Index_LabelPriority3'                          => '察応䞭タスク', 
    46       '_TodoList_Info_BlockDescList'                            => 'Todoブロック', 
    47       '_TodoList_Info_BlockTitleList'                           => 'Todoブロック', 
     72      '_TodoList_Info_BlockDescList'                            => 'ToDoブロック', 
     73      '_TodoList_Info_BlockTitleList'                           => 'ToDoブロック', 
    4874      '_TodoList_Info_Description'                              => 'ToDoの管理を行うコンポヌネントです。', 
    4975      '_TodoList_Info_DisplayName'                              => 'ToDo', 
    5076      '_TodoList_Info_MenuDescAdmin'                            => 'ToDo蚭定', 
    51       '_TodoList_Info_MenuDescIndex'                            => 'Todo', 
    52       '_TodoList_Info_MenuDescList'                             => 'Todo䞀芧', 
     77      '_TodoList_Info_MenuDescIndex'                            => 'ToDo未完了䞀芧', 
     78      '_TodoList_Info_MenuDescList'                             => 'ToDoå 
     79šä»¶äž€èЧ', 
    5380      '_TodoList_Info_MenuTitleAdmin'                           => 'ToDo蚭定', 
    54       '_TodoList_Info_MenuTitleIndex'                           => 'ToDo', 
    55       '_TodoList_Info_MenuTitleList'                            => 'ToDo䞀芧', 
     81      '_TodoList_Info_MenuTitleIndex'                           => 'ToDo未完了䞀芧', 
     82      '_TodoList_Info_MenuTitleList'                            => 'ToDoå 
     83šä»¶äž€èЧ', 
    5684      '_TodoList_Info_TrailRead'                                => 'ToDoの閲芧', 
    5785      '_TodoList_Info_TrailUpdate'                              => 'ToDoの登録・曎新・削陀', 
  • components/todo_list/trunk/todo_list/list/_main_filter.rhtml

    r5740 r5761  
    11<% render_filter({:form_options => {:url => {:controller => '/todo_list/list', :action => 'list'}, :html => {:onsubmit => 'rubricks.common.blur();'}, :update => 'todo_list_frame'}, :function_clear => 'rubricks.todo_list.list_filter_clear();', :prefix => 'todo_filter_', :switcher_options => {:open => false}}) do %> 
    22  <div class="rubricks_general_filter"> 
    3     <input type="text" id="todo_filter_word" name="todo_filter[word]" class="input_text_inactive focus" size="20" onfocus="rubricks.todo_list.list_filter_focus();" onblur="rubricks.todo_list.list_filter_blur();" /> 
     3    <input type="text" id="todo_filter_word" name="todo_filter[word]" class="input_text_inactive focus" size="32" onfocus="rubricks.todo_list.list_filter_focus();" onblur="rubricks.todo_list.list_filter_blur();" /> 
     4  </div> 
     5  <div class="rubricks_general_filter"> 
    46    <select id="todo_filter_target" name="todo_filter[target]"> 
     7      <option value="all"><%= hl('[_TodoList_Filter_TargetOptionAll]') %></option> 
    58      <option value="uncompleted"><%= hl('[_TodoList_Filter_TargetOptionUncompleted]') %></option> 
    69      <option value="completed"><%= hl('[_TodoList_Filter_TargetOptionCompleted]') %></option> 
    7       <option value="all"><%= hl('[_TodoList_Filter_TargetOptionAll]') %></option> 
     10    </select> 
     11    <select id="todo_filter_order" name="todo_filter[order]"> 
     12      <option value="all"><%= hl('[_TodoList_Filter_OrderOptionAll]') %></option> 
     13      <option value="high"><%= hl('[_TodoList_Filter_OrderOptionHigh]') %></option> 
     14      <option value="middle"><%= hl('[_TodoList_Filter_OrderOptionMiddle]') %></option> 
     15      <option value="low"><%= hl('[_TodoList_Filter_OrderOptionLow]') %></option> 
    816    </select> 
    917  </div> 
  • components/todo_list/trunk/todo_list/list/_show_edit_content.rhtml

    r5722 r5761  
    6060    </td> 
    6161  </tr> 
     62  <tr class="rubricks_general_table_even"> 
     63    <td><%= hl('[_TodoList_Common_Allot]') %></td> 
     64    <td> 
     65      <% ru = @tlt.share_worker %> 
     66      <input type="hidden" id="todo_edit_allot_to" name="todo_edit[allot_to]" <%= (ru.blank?) ? '' : %Q|value="#{ru.id}"| %> /> 
     67      <input type="text" id="todo_edit_allot_to_display" name="todo_edit[allot_to_display]" <%= (ru.blank?) ? '' : %Q|value="#{hl(ru.name)}"| %> class="background_readonly" size="24" readonly="readonly" /> 
     68      <span id="todo_edit_allot_to_select_button" class="icon_frame_inactive swap" title="<%= hl('[_Common_UserSelect]') %>" onclick="rubricks.todo_list.common_todo_allot_to_window_open();"><span class="rubricks_icon icon_user">&nbsp;</span></span><span id="todo_edit_allot_to_clear_button" class="icon_frame_inactive swap" title="<%= hl('[_Common_UserSelectClear]') %>" onclick="rubricks.todo_list.common_todo_allot_to_clear();"><span class="rubricks_icon icon_user_remove">&nbsp;</span></span> 
     69      <%= rollover_swap('todo_edit_allot_to_select_button', 'todo_edit_allot_to_clear_button') %> 
     70    </td> 
     71  </tr> 
    6272</table> 
    6373<script type="text/javascript"> 
     74  rubricks.todo_list.list_todo_edit_allot_to_value = <%= (ru.blank?) ? %q|''| : %Q|value="#{ru.id}"| %>; 
    6475  rubricks.common.datepicker.set('datepicker_todo_edit_start_on_picker_button', 'todo_edit_start_on', function() {rubricks.common.Validator.refresh_by_id('todo_edit_start_on');}); 
    6576  rubricks.common.datepicker.set('datepicker_todo_edit_close_on_picker_button', 'todo_edit_close_on', function() {rubricks.common.Validator.refresh_by_id('todo_edit_close_on');}); 
  • components/todo_list/trunk/todo_list/list/_show_print_content.rhtml

    r5722 r5761  
    1010  <tr class="rubricks_general_table_even"> 
    1111    <td><%= hl('[_TodoList_Common_StartOn]') %></td> 
    12     <td><div class="overflow_auto"><%= render_todo_date(@tlt.start_on) %></div></td> 
     12    <td><div class="overflow_auto"><%= render_todo_date(@tlt.start_on, true) %></div></td> 
    1313  </tr> 
    1414  <tr class="rubricks_general_table_even"> 
    1515    <td><%= hl('[_TodoList_Common_CloseOn]') %></td> 
    16     <td><div class="overflow_auto"><%= render_todo_date(@tlt.close_on) %><%= render_reminder(@tlt, @tlc) %></div></td> 
     16    <td><div class="overflow_auto"><%= render_todo_date(@tlt.close_on, true) %><%= render_reminder(@tlt, @tlc) %></div></td> 
    1717  </tr> 
    1818  <tr class="rubricks_general_table_even"> 
     
    2222  <tr class="rubricks_general_table_even"> 
    2323    <td><%= hl('[_TodoList_Common_Progress]') %></td> 
    24     <td><div class="overflow_auto"><%= @tlt.progress %>%</div></td> 
     24    <td> 
     25      <div class="overflow_auto"> 
     26        <%= @tlt.progress %>% 
     27        <% if @tlt.pending_approval? %> 
     28          <% if @tlt.share_creater? %> 
     29            <span class="pointcolor_text"><%= hl('[_TodoList_Common_MessageNeedApproval]') %></span> 
     30          <% else %> 
     31            <span class="pointcolor_text"><%= hl('[_TodoList_Common_MessagePendingApproval]') %></span> 
     32          <% end %> 
     33        <% end %> 
     34      </div> 
     35    </td> 
     36  </tr> 
     37  <tr class="rubricks_general_table_even"> 
     38    <td><%= hl('[_TodoList_Common_Allot]') %></td> 
     39    <td><%= render_share_info(@tlt, true) %></td> 
    2540  </tr> 
    2641</table> 
  • components/todo_list/trunk/todo_list/list/delete.rjs

    r5722 r5761  
    1 if flash[:todo_update_error] 
    2   page << %Q|rubricks.common.rubricks_message_window_open("#{hl(flash[:todo_update_error])}", 'error');| 
    3   flash[:todo_update_error] = nil 
    4 else 
    5   page << %Q|Element.update('todo_list_frame', #{simple_render_component('/todo_list/list', 'list', {}).to_json});| 
    6   page << %Q|rubricks.todo_list.list_detail_area_hide();| 
    7   page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_update_message])}");| 
    8   flash[:todo_update_message] = nil 
    9 end 
     1page << %Q|Element.update('todo_list_frame', #{simple_render_component('/todo_list/list', 'list', {}).to_json});| 
     2page << %Q|rubricks.todo_list.list_detail_area_hide();| 
     3page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_message])}");| 
     4flash[:todo_message] = nil 
  • components/todo_list/trunk/todo_list/list/list.rhtml

    r5722 r5761  
    2323      <% @tlt_list.each do |tlt| %> 
    2424        <% render_selectable_tr(tlt.id) do %> 
     25          <% render_selectable_td(:style => 'width:36px;') do %> 
     26            <div class="text_right"> 
     27              <%= tlt.progress %>% 
     28            </div> 
     29          <% end %> 
    2530          <% render_selectable_td do %> 
    2631            <div class="overflow_auto"><%= hl(tlt.title) %></div> 
  • components/todo_list/trunk/todo_list/list/main.rhtml

    r5722 r5761  
    11<div class="rubricks_general_frame_borderless"> 
    22  <% render_operation_bar do %> 
    3     <% form_tag({:controller => '/todo_list/list', :action => 'print', :page => 'print_content'}, {:id => 'operationbar_button_print', :class => 'operationbar_button_right_inactive swap',  :target => "_blank"}) do %> 
     3    <% form_tag({:controller => '/todo_list/list', :action => 'print', :print_action => 'print_content'}, {:id => 'operationbar_button_print', :class => 'operationbar_button_right_inactive swap',  :target => "_blank"}) do %> 
    44      <input type="hidden" id="todo_print_id" name="id" value="" /> 
    55      <span id="print_button" class="buttons disabled darkicon_print textcolor_white" onclick="rubricks.todo_list.list_print();"><%= hl('[_Common_Print]') %></span> 
    66    <% end %> 
    77    <div id="operationbar_button_todo_create" class="operationbar_button_left_inactive swap"> 
    8       <span id="todo_create_window_open_button" class="buttons darkicon_new textcolor_white" onclick="rubricks.todo_list.common_input_window_render(0, '/todo_list/list', 'create');"><%= hl('[_Common_New]') %></span> 
     8      <span id="todo_create_window_open_button" class="buttons darkicon_new textcolor_white" onclick="rubricks.todo_list.common_input_window_render(null, '/todo_list/list', 'create');"><%= hl('[_Common_New]') %></span> 
    99    </div> 
    1010  <% end %> 
  • components/todo_list/trunk/todo_list/list/show.rhtml

    r5722 r5761  
    44      <% render_detail('01', '[_TodoList_Common_TodoDetail]') do %> 
    55        <% render_float_button('todo_list_detail_fba1') do %> 
    6           <div id="todo_delete_form" class="float_button_right_inactive swap"> 
    7             <span id="todo_delete_confirm_button" class="buttons icon_delete" onclick="rubricks.todo_list.list_delete_confirm(<%= hl(@tlt.id) %>);"><%= hl('[_Common_Delete]') %></span> 
    8           </div> 
     6          <% if @tlt.deletable? %> 
     7            <div id="todo_delete_form" class="float_button_right_inactive swap"> 
     8              <span id="todo_delete_confirm_button" class="buttons icon_delete" onclick="rubricks.todo_list.list_delete_confirm(<%= hl(@tlt.id) %>);"><%= hl('[_Common_Delete]') %></span> 
     9            </div> 
     10          <% end %> 
    911          <div id="todo_edit_mode_form" class="float_button_right_inactive swap"> 
    1012            <span id="todo_edit_mode_button" class="buttons icon_edit" onclick="rubricks.todo_list.list_detail_edit_mode();"><%= hl('[_Common_Edit]') %></span> 
  • components/todo_list/trunk/todo_list/list/update.rjs

    r5722 r5761  
    1 if flash[:todo_update_error] 
    2   page << %Q|rubricks.common.rubricks_message_window_open("#{hl(flash[:todo_update_error])}", 'error');| 
    3   flash[:todo_update_error] = nil 
    4 else 
    5   page << %Q|Element.update('todo_list_frame', #{simple_render_component('/todo_list/list', 'list', {:id => @tlt.id}).to_json});| 
    6   page << %Q|Element.update('todo_info',       #{simple_render_component('/todo_list/list', 'show', {:id => @tlt.id}).to_json});| 
    7   page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_update_message])}");| 
    8   flash[:todo_update_message] = nil 
    9 end 
     1page << %Q|Element.update('todo_list_frame', #{simple_render_component('/todo_list/list', 'list', {:id => @tlt.id}).to_json});| 
     2page << %Q|Element.update('todo_info',       #{simple_render_component('/todo_list/list', 'show', {:id => @tlt.id}).to_json});| 
     3page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_message])}");| 
     4flash[:todo_message] = nil 
  • components/todo_list/trunk/todo_list/list_controller.rb

    r5721 r5761  
    22  define_page 
    33  uses_component_template_root 
    4   helper :'todo_list/common' 
     4  helper        :'todo_list/common' 
     5  before_filter :refuse_guest 
    56 
    67  def main 
     
    1617      logger.error(ex.message) 
    1718      logger.error(ex.backtrace.join("\n  ")) 
    18       flash[:todo_update_error] = '[_TodoList_Common_ErrorCreate]' 
     19      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorCreate]' 
    1920    end 
    2021    rubricks_logger({:action_type => :create, :data => @tlt}) 
    21     flash[:todo_update_message] = '[_TodoList_Common_MessageCreate]' 
     22    flash[:todo_message] = '[_TodoList_Common_MessageCreate]' 
    2223    headers["Content-Type"] = "text/javascript" 
    2324    render :template => '/todo_list/list/update.rjs' 
     
    3637      logger.error(ex.message) 
    3738      logger.error(ex.backtrace.join("\n  ")) 
    38       flash[:todo_update_error] = '[_TodoList_Common_ErrorDelete]' 
     39      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorDelete]' 
    3940    end 
    40     flash[:todo_update_message] = '[_TodoList_Common_MessageDelete]' 
     41    flash[:todo_message] = '[_TodoList_Common_MessageDelete]' 
    4142    headers["Content-Type"] = "text/javascript" 
    4243    render :template => '/todo_list/list/delete.rjs' 
     
    4849    filter_conditions = filter_merge_conditions({:input_data => params[:todo_filter], :page => params[:page].to_i}) 
    4950    @search           = filter_conditions[:search] 
    50     count             = TodoList::TodoListTodo.count(:all, :conditions => filter_conditions[:conditions]
     51    count             = TodoList::TodoListTodo.count(:all, :conditions => filter_conditions[:conditions], :include => :todo_list_category_boxes
    5152    @pages            = ::ActionController::Pagination::Paginator.new(self, count, per_page, filter_conditions[:page]) 
    52     @tlt_list         = TodoList::TodoListTodo.find(:all, :conditions => filter_conditions[:conditions], :limit => @pages.items_per_page, :offset => @pages.current.offset
     53    @tlt_list         = TodoList::TodoListTodo.find(:all, :conditions => filter_conditions[:conditions], :include => :todo_list_category_boxes, :limit => @pages.items_per_page, :offset => @pages.current.offset, :order => 'todo_list_todos.id desc'
    5354    rubricks_logger({:action_type => :list, :data => @tlt_list}) 
    5455  end 
     
    5758    @tlc = TodoList::TodoListConfig.instance 
    5859    @tlt = TodoList::TodoListTodo.find(params[:id]) 
     60    raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUneditable]' unless @tlt.editable? 
    5961  end 
    6062 
     
    6365      @tlc = TodoList::TodoListConfig.instance 
    6466      @tlt = TodoList::TodoListTodo.find(params[:id]) 
     67      raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUneditable]' unless @tlt.editable? 
    6568      rubricks_logger({:action_type => :detail, :data => @tlt}) 
    6669    else 
     
    7578      end 
    7679    rescue Exception => ex 
    77       logger.error(ex.message) 
    78       logger.error(ex.backtrace.join("\n  ")) 
    79       flash[:todo_update_error] = '[_TodoList_Common_ErrorUpdate]' 
     80      if ex.is_a?(RubricksError::Common::AjaxError) 
     81        raise ex 
     82      else 
     83        logger.error(ex.message) 
     84        logger.error(ex.backtrace.join("\n  ")) 
     85        raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUpdate]' 
     86      end 
    8087    end 
    8188    rubricks_logger({:action_type => :update, :data => @tlt}) 
    82     flash[:todo_update_message] = '[_TodoList_Common_MessageUpdate]' 
     89    flash[:todo_message] = (@tlt.pending_approval?) ? '[_TodoList_Common_MessageUpdatePendingApproval]' : '[_TodoList_Common_MessageUpdate]' 
    8390    headers["Content-Type"] = "text/javascript" 
    8491    render :template => '/todo_list/list/update.rjs' 
  • components/todo_list/trunk/todo_list/preload/_preload.rhtml

    r5721 r5761  
    1 <%= stylesheet_link_tag '/stylesheets/components/todo_list/todo' %> 
     1<%= stylesheet_link_tag    '/stylesheets/components/todo_list/todo' %> 
    22<%= javascript_include_tag '/javascripts/components/todo_list/todo' %> 
    33<script type="text/javascript"> 
    44  Object.extend(rubricks.todo_list, { 
    5     int_progress_index_max: <%= TodoList::TodoListTodo::PROGRESS_RANGE.length.to_i - 1 %>, 
    6     msg_delete_confirm:     '<%= jl('[_Common_Delete_Confirm]') %>', 
    7     msg_finish_confirm:     '<%= jl('[_TodoList_Common_MessageFinishConfirm]') %>', 
    8     msg_todo_not_selected:  '<%= jl('[_TodoList_Common_ErrorTodoNotSelected]') %>', 
    9     url_common_input:       '<%= url_for(:controller => '/todo_list/common', :action => 'input') %>', 
    10     url_index_delete:       '<%= url_for(:controller => '/todo_list/index',  :action => 'delete') %>', 
    11     url_index_finish:       '<%= url_for(:controller => '/todo_list/index',  :action => 'finish') %>', 
    12     url_list_delete:        '<%= url_for(:controller => '/todo_list/list',   :action => 'delete') %>', 
    13     url_list_show:          '<%= url_for(:controller => '/todo_list/list',   :action => 'show') %>' 
     5    int_progress_index_max:     <%= TodoList::TodoListTodo::PROGRESS_RANGE.length.to_i - 1 %>, 
     6    msg_delete_confirm:         '<%= jl('[_Common_Delete_Confirm]') %>', 
     7    msg_finish_confirm:         '<%= jl('[_TodoList_Common_MessageFinishConfirm]') %>', 
     8    msg_todo_not_selected:      '<%= jl('[_TodoList_Common_ErrorTodoNotSelected]') %>', 
     9    rollover:                   function() {<%= TodoList::TodoListLib::USER_SELECT_WINDOW[:prefix] %>._rollover();}, 
     10    url_common_allot_to_window: '<%= url_for(:controller => '/todo_list/common', :action => 'allot_to_window') %>', 
     11    url_common_input:           '<%= url_for(:controller => '/todo_list/common', :action => 'input') %>', 
     12    url_index_category_window:  '<%= url_for(:controller => '/todo_list/index',  :action => 'category_window') %>', 
     13    url_index_change_progress:  '<%= url_for(:controller => '/todo_list/index',  :action => 'change_progress') %>', 
     14    url_index_delete:           '<%= url_for(:controller => '/todo_list/index',  :action => 'delete') %>', 
     15    url_index_finish:           '<%= url_for(:controller => '/todo_list/index',  :action => 'finish') %>', 
     16    url_list_delete:            '<%= url_for(:controller => '/todo_list/list',   :action => 'delete') %>', 
     17    url_list_show:              '<%= url_for(:controller => '/todo_list/list',   :action => 'show') %>' 
    1418  }); 
    1519</script> 
    16 <% render_window('todo_input_window', 'rubricks.todo_list.todo_input_window', '[_TodoList_Common_InputWindowTitle]', {:width => 640, :height => 510, :onCloseButton => 'function() {rubricks.todo_list.common_input_window_close();}', :appendToBody => true}) do %> 
     20<% render_window('todo_input_window', 'rubricks.todo_list.todo_input_window', '[_TodoList_Common_InputWindowTitle]', {:width => 640, :height => 540, :onCloseButton => 'function() {rubricks.todo_list.common_input_window_close();}', :appendToBody => true}) do %> 
    1721  <div id="todo_input_window_contents"></div> 
    1822<% end %> 
     23<div id="todo_allot_to_window_frame"></div> 
  • components/todo_list/trunk/todo_list/todo_list_category_box.rb

    r5721 r5761  
    11class TodoList::TodoListCategoryBox < ActiveRecord::Base 
    22  acts_as_record_trails     :trails_fields => {:title => '[_Common_Title]'}, :default_methods => [:title] 
    3   has_many                  :todo_list_todos 
     3  has_many                  :todo_list_todos,       :through => :todo_list_todo_links 
     4  has_many                  :todo_list_todo_links,  :dependent => :destroy 
    45  belongs_to                :rubricks_user 
    5   validates_length_of       :title, :in => 1..15 
    6   validates_numericality_of :box_no, :only_integer => true 
    7   validates_inclusion_of    :box_no, :in=>1..3 
     6  validates_length_of       :title,                 :in => 1..16 
     7  validates_numericality_of :box_no,                :only_integer => true 
     8  validates_inclusion_of    :box_no,                :in => 1..3 
    89 
    910  unless defined? BOX_NUMBERS 
     
    1213 
    1314  class << self 
    14     def find_or_create_boxes(ru_id
    15       tlcb_list = self.find(:all, :conditions => ['rubricks_user_id = ?', ru_id], :order => 'box_no desc'
     15    def find_or_create_boxes(ru_id, options = {}
     16      tlcb_list = self.find(:all, {:conditions => ['rubricks_user_id = ?', ru_id], :order => 'box_no desc'}
    1617      if tlcb_list.blank? 
    1718        tlcb_list = [] 
    1819        BOX_NUMBERS.each do |no| 
    19           tlcb_list << self.create(:title => RubricksLib.hl("[_TodoList_Index_LabelPriority#{no}]"), :box_no => no, :rubricks_user_id => ru_id) 
     20          tlcb = self.new(:title => RubricksLib.hl("[_TodoList_Index_LabelPriority#{no}]"), :box_no => no, :rubricks_user_id => ru_id) 
     21          tlcb.ignore_csrf_validation = true 
     22          tlcb.save! 
     23          tlcb_list << tlcb 
    2024        end 
    2125      end 
     
    2529 
    2630  def current_todos 
    27     TodoList::TodoListTodo.find(:all, :conditions => ['todo_list_category_box_id = ? and closed_on is null', self.id], :order => 'order_in_box asc') 
     31    TodoList::TodoListTodo.find(:all, :conditions => ['todo_list_todos.closed_on is null and todo_list_category_boxes.id = ?', self.id], :include => :todo_list_category_boxes, :order => 'todo_list_todo_links.todo_order asc') 
    2832  end 
    2933end 
  • components/todo_list/trunk/todo_list/todo_list_config.rb

    r5721 r5761  
    99  class << self 
    1010    def instance 
    11       self.find(1) rescue self.create!({:site_reminder_flag => false, :site_remind_hour => 0, :site_remind_min => 0}) 
     11      self.find(1) 
    1212    end 
    1313  end 
  • components/todo_list/trunk/todo_list/todo_list_lib.rb

    r5721 r5761  
    11class TodoList::TodoListLib 
     2  unless defined? USER_SELECT_WINDOW 
     3    USER_SELECT_WINDOW  = { 
     4      :prefix => 'rubricks.system.user.user_select.todo_allot_to_', 
     5      :window => %q|render_user_select_window({:element_id => 'todo_allot_to_window', :js_options => {:appendToBody => true}, :options => {:limit => 1, :prefix => 'todo_allot_to_'}, :title => hl('[_TodoList_Common_Allot]'), :variable => 'rubricks.todo_list.todo_allot_to_window'})|, 
     6    } 
     7  end 
     8 
    29  class << self 
    310    def deadline_message(distance) 
  • components/todo_list/trunk/todo_list/todo_list_todo.rb

    r5738 r5761  
    22  unless defined? DEADLINE_CAUTION 
    33    DEADLINE_CAUTION    = 5 
    4     ORDER_MAX           = 65535 
     4    ORDER_VALUE         = {:high => 3, :middle => 2, :low => 1} 
    55    PROGRESS_RANGE      = [0,10,20,30,40,50,60,70,80,90,100] 
    66  end 
    77 
    88  acts_as_record_trails     :trails_fields => {:title => '[_Common_Title]'}, :default_methods => [:title] 
    9   belongs_to                :todo_list_category_box 
     9  has_many                  :todo_list_category_boxes,  :through => :todo_list_todo_links 
     10  has_many                  :todo_list_todo_links,      :dependent => :destroy 
    1011  validates_bool_of         :reminder_flag 
    1112  validates_bool_of         :sync_calendar_flag 
    12   validates_numericality_of :order_in_box, :only_integer => true 
    13   validates_inclusion_of    :order_in_box, :in=>0..ORDER_MAX 
    14   validates_numericality_of :progress, :only_integer => true 
    15   validates_inclusion_of    :progress, :in => PROGRESS_RANGE 
    16   validates_numericality_of :reminder_delay, :only_integer => true 
    17   validates_inclusion_of    :reminder_delay, :in => 0..5 
    18   validates_numericality_of :reminder_every, :only_integer => true 
    19   validates_inclusion_of    :reminder_every, :in => 0..1 
    20   validates_numericality_of :this_order, :only_integer => true 
    21   validates_inclusion_of    :this_order, :in => 1..3 
    22   validates_numericality_of :todo_list_category_box_id, :only_integer => true 
    23   validates_length_of       :title, :in => 1..30 
    24   validates_length_of       :content, :in => 0..1500, :allow_nil => true 
    25   validates_date_of         :created_on, :allow_nil => true 
    26   validates_date_of         :updated_on, :allow_nil => true 
    27   validates_date_of         :start_on, :allow_nil => true 
    28   validates_date_of         :close_on, :allow_nil => true 
    29   validates_date_of         :closed_on, :allow_nil => true 
     13  validates_numericality_of :progress,                  :only_integer => true 
     14  validates_inclusion_of    :progress,                  :in => PROGRESS_RANGE 
     15  validates_numericality_of :reminder_delay,            :only_integer => true 
     16  validates_inclusion_of    :reminder_delay,            :in => 0..5 
     17  validates_numericality_of :reminder_every,            :only_integer => true 
     18  validates_inclusion_of    :reminder_every,            :in => 0..1 
     19  validates_numericality_of :this_order,                :only_integer => true 
     20  validates_inclusion_of    :this_order,                :in => 1..3 
     21  validates_length_of       :title,                     :in => 1..30 
     22  validates_length_of       :content,                   :in => 0..1500, :allow_nil => true 
     23  validates_date_of         :created_on,                :allow_nil => true 
     24  validates_date_of         :updated_on,                :allow_nil => true 
     25  validates_date_of         :start_on,                  :allow_nil => true 
     26  validates_date_of         :close_on,                  :allow_nil => true 
     27  validates_date_of         :closed_on,                 :allow_nil => true 
     28  before_destroy            :raise_unless_deletable 
     29  before_update             :raise_unless_editable 
    3030 
    3131  class << self 
     
    3535        input_data[:id] = tlt.id 
    3636      end 
    37       tlt = self.find(input_data[:id], :include => :todo_list_category_box
     37      tlt = self.find(input_data[:id]
    3838      tlt.update_todo(input_data) 
    3939      return tlt 
     
    4141 
    4242    def create_todo 
    43       self.create!({ 
    44         :todo_list_category_box_id  => TodoList::TodoListCategoryBox.find_or_create_boxes(RubricksLib.current_user.id)[1].id, 
    45         :title                      => ' ', 
    46         :content                    => ' ', 
    47       }) 
     43      tlt = self.create!({:title => ' ', :content => ' '}) 
     44      tlcb = TodoList::TodoListCategoryBox.find_or_create_boxes(RubricksLib.current_user.id)[1] 
     45      TodoList::TodoListTodoLink.create!({:todo_list_category_box_id => tlcb.id, :todo_list_todo_id => tlt.id, :todo_order => TodoList::TodoListTodoLink::ORDER_MAX}) 
     46      return tlt 
    4847    end 
    4948 
    5049    def filter_merge_conditions(filter_conditions_hash) 
    5150      filter_conditions, query, conditions = {}, [], [] 
    52       query         << 'todo_list_category_box_id in (?)' 
     51      query         << 'todo_list_category_boxes.id in (?)' 
    5352      conditions    << TodoList::TodoListCategoryBox.find_or_create_boxes(RubricksLib.current_user.id).map{|tlcb| tlcb.id} 
    5453      case filter_conditions_hash[:target] 
    55       when 'all' 
    5654      when 'completed' 
    5755        query       << 'closed_on is not null' 
    58       else 
     56      when 'uncompleted' 
    5957        query       << 'closed_on is null' 
    6058      end 
     59      case filter_conditions_hash[:order] 
     60      when 'high' 
     61        query       << 'this_order = ?' 
     62        conditions  << ORDER_VALUE[:high] 
     63      when 'low' 
     64        query       << 'this_order = ?' 
     65        conditions  << ORDER_VALUE[:low] 
     66      when 'middle' 
     67        query       << 'this_order = ?' 
     68        conditions  << ORDER_VALUE[:middle] 
     69      end 
    6170      unless filter_conditions_hash[:word].blank? 
    62         fixed_word   = '%' + filter_conditions_hash[:word] + '%' 
    63         query       << '(title like ? or content like ?)' 
    64         conditions  << fixed_word 
    65         conditions  << fixed_word 
     71        t_conditions = RubricksLib.query_to_conditions(filter_conditions_hash[:word], ['todo_list_todos.title', 'todo_list_todos.content']) 
     72        query       << t_conditions.shift 
     73        conditions.concat(t_conditions) 
    6674      end 
    6775      date_range = RubricksLib.dates_to_range(filter_conditions_hash[:start_on], filter_conditions_hash[:close_on]) 
     
    109117        filter_conditions_hash[:word]       = input_data[:word]     unless input_data[:word].nil? 
    110118        filter_conditions_hash[:target]     = input_data[:target]   unless input_data[:target].nil? 
     119        filter_conditions_hash[:order]      = input_data[:order]    unless input_data[:order].nil? 
    111120        filter_conditions_hash[:start_on]   = input_data[:start_on] unless input_data[:start_on].nil? 
    112121        filter_conditions_hash[:close_on]   = input_data[:close_on] unless input_data[:close_on].nil? 
     
    127136 
    128137    def finish_todo(id) 
     138      self.progress(id, PROGRESS_RANGE.last) 
     139    end 
     140 
     141    def progress(id, progress) 
    129142      tlt = self.find(id) 
    130       tlt.update_todo({:progress => PROGRESS_RANGE.last}) 
     143      tlt.update_todo({:progress => progress, :ignore_share => true}) 
    131144    end 
    132145 
     
    135148      unless options[:tlt_id_list].nil? 
    136149        tlcb = TodoList::TodoListCategoryBox.find(:first, :conditions => ['rubricks_user_id = ? and box_no = ?', RubricksLib.current_user.id, options[:box_no]]) 
    137         self.find(:all, :conditions => ['todo_list_todos.id in (?)', options[:tlt_id_list]], :include => :todo_list_category_box).each do |tlt| 
    138           tlt.update_attributes!(:todo_list_category_box_id => tlcb.id, :order_in_box => options[:tlt_id_list].index(tlt.id.to_s)) 
    139         end 
    140       end 
    141     end 
     150        TodoList::TodoListTodoLink.refresh_links(tlcb.id, options[:tlt_id_list]) 
     151      end 
     152    end 
     153  end 
     154 
     155  def deletable? 
     156    return true  unless self.share? 
     157    return true  if self.share_creater? 
     158    return true  if self.share_creater.effective.blank? 
     159    return false 
    142160  end 
    143161 
     
    152170  end 
    153171 
     172  def editable?(ru_id = nil) 
     173    ru_id ||= RubricksLib.current_user.id 
     174    if self.share? 
     175      tltl_list     = TodoList::TodoListTodoLink.find(:all, :conditions => ['todo_list_todo_id = ?', self.id], :include => :todo_list_category_box) 
     176      ru_id_list    = tltl_list.map{|tltl| tltl.todo_list_category_box.rubricks_user_id} 
     177      return ru_id_list.include?(ru_id) 
     178    else 
     179      return self.todo_list_category_boxes.first.rubricks_user_id == ru_id 
     180    end 
     181  end 
     182 
     183  def pending_approval? 
     184    return self.progress == PROGRESS_RANGE.last && self.closed_on.nil? 
     185  end 
     186 
    154187  def remind_unwanted? 
    155188    if(Time.now >= Time.at(self.close_on - self.reminder_delay.day)) 
     
    159192    end 
    160193    return true 
     194  end 
     195 
     196  def share? 
     197    self.todo_list_todo_links.length > 1 
     198  end 
     199 
     200  def share_creater 
     201    ru_id = nil 
     202    self.todo_list_todo_links.each do |tltl| 
     203      ru_id = tltl.todo_list_category_box.rubricks_user_id if tltl.share_creater? 
     204    end 
     205    ru = RubricksUser.find(ru_id) rescue nil 
     206    return ru 
     207  end 
     208 
     209  def share_creater?(ru_id = nil) 
     210    return false unless self.share? 
     211    ru_id ||= RubricksLib.current_user.id 
     212    self.todo_list_todo_links.each do |tltl| 
     213      return true if tltl.todo_list_category_box.rubricks_user_id == ru_id && tltl.share_creater? 
     214    end 
     215    return false 
     216  end 
     217 
     218  def share_middleman?(ru_id = nil) 
     219    return false unless self.share? 
     220    ru_id ||= RubricksLib.current_user.id 
     221    self.todo_list_todo_links.each do |tltl| 
     222      return true if tltl.todo_list_category_box.rubricks_user_id == ru_id && tltl.share_middleman? 
     223    end 
     224    return false 
     225  end 
     226 
     227  def share_status(ru_id = nil) 
     228    ru_id ||= RubricksLib.current_user.id 
     229    self.todo_list_todo_links.each do |tltl| 
     230      return tltl.share_status if tltl.todo_list_category_box.rubricks_user_id == ru_id 
     231    end 
     232    return nil 
     233  end 
     234 
     235  def share_worker 
     236    ru_id = nil 
     237    self.todo_list_todo_links.each do |tltl| 
     238      ru_id = tltl.todo_list_category_box.rubricks_user_id if tltl.share_worker? 
     239    end 
     240    ru = RubricksUser.find(ru_id) rescue nil 
     241    return ru 
     242  end 
     243 
     244  def share_worker?(ru_id = nil) 
     245    return false unless self.share? 
     246    ru_id ||= RubricksLib.current_user.id 
     247    self.todo_list_todo_links.each do |tltl| 
     248      return true if tltl.todo_list_category_box.rubricks_user_id == ru_id && tltl.share_worker? 
     249    end 
     250    return false 
     251  end 
     252 
     253  def to_schedule 
     254    range = self.close_on.to_date.to_range 
     255    return RubricksSchedule.new({:id => self.id, :start => range.first, :finish => range.last, :description => self.title}) 
    161256  end 
    162257 
     
    166261    self.start_on   = input_data[:start_on]   unless input_data[:start_on].nil? 
    167262    self.close_on   = input_data[:close_on]   unless input_data[:close_on].nil? 
    168     self.closed_on  = Date.today              if self.progress != PROGRESS_RANGE.last && input_data[:progress].to_i == PROGRESS_RANGE.last 
    169     self.closed_on  = nil                     if input_data[:progress] && input_data[:progress].to_i != PROGRESS_RANGE.last 
    170     self.this_order = input_data[:this_order] unless input_data[:close_on].blank? 
     263    self.this_order = input_data[:this_order] unless input_data[:this_order].blank? 
    171264    self.progress   = input_data[:progress]   unless input_data[:progress].blank? 
    172     set_category 
     265    set_closed_on(input_data) 
    173266    set_reminder(input_data) 
    174267    self.save! 
     268    TodoList::TodoListTodoLink.share(self, input_data[:allot_to]) if input_data[:ignore_share].blank? 
    175269    return self 
    176270  end 
    177271 
    178   def validate 
    179     raise_if_invalid_user 
    180   end 
    181  
    182272  private 
    183   def raise_if_invalid_user 
    184     raise RubricksError::Common::ValidateException unless self.todo_list_category_box.rubricks_user_id == RubricksLib.current_user.id 
    185   end 
    186  
    187   def set_category 
    188     self.todo_list_category_box_id ||= TodoList::TodoListCategoryBox.find_or_create_boxes(RubricksLib.current_user.id)[1].id 
     273  def raise_unless_deletable 
     274    raise RubricksError::Common::ValidateException unless self.deletable? 
     275  end 
     276 
     277  def raise_unless_editable 
     278    raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUneditable]' unless self.editable? 
     279  end 
     280 
     281  def set_closed_on(input_data) 
     282    if self.deletable? 
     283      self.closed_on = Date.today if self.closed_on.nil? && input_data[:progress].to_i == PROGRESS_RANGE.last 
     284    end 
     285    self.closed_on = nil if input_data[:progress] && input_data[:progress].to_i != PROGRESS_RANGE.last 
    189286  end 
    190287