Changeset 5761
- Timestamp:
- 05/22/08 15:43:06 (2 years ago)
- Files:
-
- components/todo_list/trunk/todo_list/_install/db/001_todo_list_schema_001.rb (modified) (3 diffs)
- components/todo_list/trunk/todo_list/_install/db/002_todo_list_schema_002.rb (modified) (2 diffs)
- components/todo_list/trunk/todo_list/_install/db/003_todo_list_schema_003.rb (added)
- components/todo_list/trunk/todo_list/_install/db/004_todo_list_schema_004.rb (added)
- components/todo_list/trunk/todo_list/_install/images/progress_empty.gif (added)
- components/todo_list/trunk/todo_list/_install/images/progress_fill.gif (added)
- components/todo_list/trunk/todo_list/_install/images/progress_left.gif (added)
- components/todo_list/trunk/todo_list/_install/images/progress_left_active.gif (added)
- components/todo_list/trunk/todo_list/_install/images/progress_right.gif (added)
- components/todo_list/trunk/todo_list/_install/images/progress_right_active.gif (added)
- components/todo_list/trunk/todo_list/_install/javascripts/src_todo.js (modified) (7 diffs)
- components/todo_list/trunk/todo_list/_install/javascripts/todo.js (modified) (8 diffs)
- components/todo_list/trunk/todo_list/_install/stylesheets/todo.css (modified) (4 diffs)
- components/todo_list/trunk/todo_list/admin/_main_read_content.rhtml (modified) (1 diff)
- components/todo_list/trunk/todo_list/admin/main.rhtml (modified) (2 diffs)
- components/todo_list/trunk/todo_list/admin_controller.rb (modified) (2 diffs)
- components/todo_list/trunk/todo_list/block/list.rhtml (modified) (1 diff)
- components/todo_list/trunk/todo_list/block/update.rjs (modified) (1 diff)
- components/todo_list/trunk/todo_list/block_controller.rb (modified) (2 diffs)
- components/todo_list/trunk/todo_list/common/_todo_input_window.rhtml (modified) (5 diffs)
- components/todo_list/trunk/todo_list/common/allot_to_window.rhtml (added)
- components/todo_list/trunk/todo_list/common_controller.rb (modified) (1 diff)
- components/todo_list/trunk/todo_list/common_helper.rb (modified) (4 diffs)
- components/todo_list/trunk/todo_list/component_plugins/calendar/init.rb (modified) (1 diff)
- components/todo_list/trunk/todo_list/component_plugins/calendar/lib/todo_list_adapter.rb (modified) (1 diff)
- components/todo_list/trunk/todo_list/index/_todo.rhtml (modified) (3 diffs)
- components/todo_list/trunk/todo_list/index/category_update.rjs (added)
- components/todo_list/trunk/todo_list/index/category_window.rhtml (added)
- components/todo_list/trunk/todo_list/index/main.rhtml (modified) (2 diffs)
- components/todo_list/trunk/todo_list/index/show.rhtml (modified) (2 diffs)
- components/todo_list/trunk/todo_list/index/update.rjs (modified) (1 diff)
- components/todo_list/trunk/todo_list/index_controller.rb (modified) (5 diffs)
- components/todo_list/trunk/todo_list/languages/english.rb (modified) (3 diffs)
- components/todo_list/trunk/todo_list/languages/japanese.rb (modified) (4 diffs)
- components/todo_list/trunk/todo_list/list/_main_filter.rhtml (modified) (1 diff)
- components/todo_list/trunk/todo_list/list/_show_edit_content.rhtml (modified) (1 diff)
- components/todo_list/trunk/todo_list/list/_show_print_content.rhtml (modified) (2 diffs)
- components/todo_list/trunk/todo_list/list/delete.rjs (modified) (1 diff)
- components/todo_list/trunk/todo_list/list/list.rhtml (modified) (1 diff)
- components/todo_list/trunk/todo_list/list/main.rhtml (modified) (1 diff)
- components/todo_list/trunk/todo_list/list/show.rhtml (modified) (1 diff)
- components/todo_list/trunk/todo_list/list/update.rjs (modified) (1 diff)
- components/todo_list/trunk/todo_list/list_controller.rb (modified) (7 diffs)
- components/todo_list/trunk/todo_list/preload/_preload.rhtml (modified) (1 diff)
- components/todo_list/trunk/todo_list/todo_list_category_box.rb (modified) (3 diffs)
- components/todo_list/trunk/todo_list/todo_list_config.rb (modified) (1 diff)
- components/todo_list/trunk/todo_list/todo_list_lib.rb (modified) (1 diff)
- components/todo_list/trunk/todo_list/todo_list_todo.rb (modified) (9 diffs)
- components/todo_list/trunk/todo_list/todo_list_todo_link.rb (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
components/todo_list/trunk/todo_list/_install/db/001_todo_list_schema_001.rb
r5721 r5761 1 1 class 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 2 11 def self.up 3 12 #################################################################################################################### … … 34 43 t.column :title, :string, :limit => 90, :default => '', :null => false 35 44 end 36 45 37 46 create_table :todo_list_configs, :force => true do |t| 38 47 t.column :site_reminder_flag, :integer, :default => 0, :null => false … … 46 55 add_index(:todo_list_todos, [:rubricks_user_id_owner, :closed_flag, :delete_flag, :reminder_flag, :close_on], {:name => 'todo_list_todos_idx_1'}) 47 56 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}) 48 62 end 49 63 components/todo_list/trunk/todo_list/_install/db/002_todo_list_schema_002.rb
r5725 r5761 15 15 #################################################################################################################### 16 16 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 17 23 menu_icon = RubricksMenuIcon.find_by_title('[_TodoList_Title]') 18 24 menu_icon.update_attributes(:title => '[_TodoList_Info_DisplayName]') unless menu_icon.blank? … … 38 44 remove_column :todo_list_todos, :category 39 45 change_column :todo_list_configs, :site_reminder_flag, :boolean, :default => false, :null => false 40 41 ####################################################################################################################42 # Indexes43 ####################################################################################################################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'})46 46 end 47 47 components/todo_list/trunk/todo_list/_install/javascripts/src_todo.js
r5721 r5761 8 8 rubricks.common.FormEditor.readMode('todo_edit_area', 'todo_edit_form'); 9 9 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(); 10 14 }, 11 15 admin_toggle_reminder_flag: function() { … … 67 71 ); 68 72 }, 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 }, 69 126 index_delete: function() { 70 127 new Ajax.Request( 71 128 this.url_index_delete, 72 129 { 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();} 78 135 } 79 136 ); … … 87 144 this.url_index_finish, 88 145 { 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();} 94 151 } 95 152 ); … … 102 159 rubricks.common.fire_submit('operationbar_button_print'); 103 160 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 ); 104 233 }, 105 234 list_add_ajax_history: function(tlt_id) { … … 115 244 rubricks.todo_list.url_list_delete, 116 245 { 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();} 122 251 } 123 252 ); … … 143 272 }, 144 273 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 } 145 279 rubricks.common.FormEditor.editMode('todo_info_management_area'); 146 280 this.list_input_toggle_reminder(); … … 259 393 rubricks.todo_list.url_list_show, 260 394 { 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();} 266 400 } 267 401 ); components/todo_list/trunk/todo_list/_install/javascripts/todo.js
r5721 r5761 5 5 rubricks.common.FormEditor.readMode("todo_edit_area","todo_edit_form"); 6 6 this.admin_toggle_reminder_flag(); 7 },admin_print:function(){ 8 rubricks.common.fire_submit("todo_list_admin_print_form","print_button"); 9 rubricks.common.rubricks_wait_message_close(); 7 10 },admin_toggle_reminder_flag:function(){ 8 11 if($("todo_config_site_reminder_flag_use").checked==true){ … … 48 51 rubricks.common.rubricks_wait_message_open(); 49 52 }}); 53 },common_todo_allot_to_clear:function(){ 54 var el; 55 el=$("todo_allot_to"); 56 if(el){ 57 el.value=""; 58 $("todo_allot_to_display").value=""; 59 } 60 el=$("todo_edit_allot_to"); 61 if(el){ 62 el.value=""; 63 $("todo_edit_allot_to_display").value=""; 64 } 65 },common_todo_allot_to_set:function(_b){ 66 if(_b){ 67 var el; 68 el=$("todo_allot_to"); 69 if(el){ 70 el.value=_b.id; 71 $("todo_allot_to_display").value=_b.name.unescapeHTML(); 72 } 73 el=$("todo_edit_allot_to"); 74 if(el){ 75 el.value=_b.id; 76 $("todo_edit_allot_to_display").value=_b.name.unescapeHTML(); 77 } 78 }else{ 79 this.common_todo_allot_to_clear(); 80 } 81 },common_todo_allot_to_window_close:function(){ 82 this.todo_allot_to_window.close(); 83 },common_todo_allot_to_window_open:function(){ 84 if(this.flg_todo_allot_to_window_loaded){ 85 this.rollover(); 86 this.todo_allot_to_window.center(); 87 this.todo_allot_to_window.open(); 88 }else{ 89 this.common_todo_allot_to_window_render(); 90 } 91 },common_todo_allot_to_window_render:function(){ 92 new Ajax.Updater("todo_allot_to_window_frame",rubricks.todo_list.url_common_allot_to_window,{asynchronous:true,evalScripts:true,onLoading:function(_d){ 93 rubricks.common.rubricks_wait_message_open(); 94 }}); 50 95 },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){96 new Ajax.Request(this.url_index_delete,{asynchronous:true,evalScripts:true,parameters:{id:this.delete_target},onLoaded:function(_e){ 97 rubricks.common.rubricks_wait_message_close(); 98 },onLoading:function(_f){ 54 99 rubricks.common.rubricks_wait_message_open(); 55 100 }}); … … 60 105 }); 61 106 },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){107 new Ajax.Request(this.url_index_finish,{asynchronous:true,evalScripts:true,parameters:{id:this.finish_target},onLoaded:function(_11){ 108 rubricks.common.rubricks_wait_message_close(); 109 },onLoading:function(_12){ 65 110 rubricks.common.rubricks_wait_message_open(); 66 111 }}); … … 73 118 rubricks.common.fire_submit("operationbar_button_print"); 74 119 rubricks.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){ 121 el.src=el.src.replace(/progress_(left|right)\.gif/,"progress_$1_active.gif"); 122 },index_progress_arrow_psv:function(el){ 123 el.src=el.src.replace(/progress_(left|right)_active\.gif/,"progress_$1.gif"); 124 },index_progress_change:function(el,id,_18){ 125 var _19=(_18/2).toString()+"px"; 126 Element.setStyle(el,{"width":_19}); 127 _18=_18.toString(); 128 Element.update("todo_progress_text_"+id,_18); 129 el.name=_18; 130 this.progress_params={id:id,progress:_18}; 131 this.index_progress_timer_set(); 132 },index_progress_decrease:function(id){ 133 var el=$("todo_progress_"+id); 134 var _1c=parseInt(el.name,10); 135 if(_1c>=10){ 136 this.index_progress_change(el,id,_1c-10); 137 } 138 },index_progress_increase:function(id){ 139 var el=$("todo_progress_"+id); 140 var _1f=parseInt(el.name,10); 141 if(_1f>=90){ 142 this.index_finish_confirm(id); 143 }else{ 144 this.index_progress_change(el,id,_1f+10); 145 } 146 },index_progress_post:function(){ 147 rubricks.todo_list.index_progress_timer_clear(); 148 new 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(){ 150 if(this.progress_timer){ 151 clearTimeout(this.progress_timer); 152 this.progress_timer=null; 153 } 154 },index_progress_timer_set:function(){ 155 this.index_progress_timer_clear(); 156 this.progress_timer=setTimeout(rubricks.todo_list.index_progress_post,1000); 157 },index_todo_category_edit_window_close:function(){ 158 this.todo_category_edit_window.close(); 159 },index_todo_category_edit_window_open:function(){ 160 this.todo_category_edit_window.center(); 161 this.todo_category_edit_window.open(); 162 },index_todo_category_edit_window_render:function(id){ 163 new Ajax.Updater("todo_category_edit_window_frame",this.url_index_category_window,{asynchronous:true,evalScripts:true,parameters:{id:id},onLoaded:function(_21){ 164 rubricks.common.rubricks_wait_message_close(); 165 },onLoading:function(_22){ 166 rubricks.common.rubricks_wait_message_open(); 167 }}); 168 },list_add_ajax_history:function(_23){ 169 if(AjaxHistoryPageManager.getSpecifiedValue(this._ajax_history_prefix)==_23){ 170 this.list_show_todo_info(_23); 171 }else{ 172 AjaxHistory.add(_23,{prefix:this._ajax_history_prefix}); 80 173 } 81 174 },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){175 var _25=id||this.delete_id_str; 176 new Ajax.Request(rubricks.todo_list.url_list_delete,{asynchronous:true,evalScripts:true,parameters:{delete_id:_25},onLoaded:function(_26){ 177 rubricks.common.rubricks_wait_message_close(); 178 },onLoading:function(_27){ 179 rubricks.common.rubricks_wait_message_open(); 180 }}); 181 },list_delete_confirm:function(_28){ 89 182 rubricks.common.rubricks_confirm_window_open(this.msg_delete_confirm,function(){ 90 rubricks.todo_list.list_delete(_ 15);183 rubricks.todo_list.list_delete(_28); 91 184 }); 92 185 },list_delete_multiple:function(){ … … 106 199 Element.show("todo_info"); 107 200 },list_detail_edit_mode:function(){ 201 $("todo_edit_form").reset(); 202 var el=$("todo_edit_allot_to"); 203 if(el){ 204 el.value=this.list_todo_edit_allot_to_value; 205 } 108 206 rubricks.common.FormEditor.editMode("todo_info_management_area"); 109 207 this.list_input_toggle_reminder(); … … 133 231 rubricks.common.Validator.refresh_by_id("todo_edit_start_on"); 134 232 },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;233 var _2a=$("todo_edit_reminder_flag"); 234 if(_2a){ 235 var _2b=$("todo_edit_close_on"); 236 var _2c=$("todo_edit_close_on_msg"); 237 var _2d=$("todo_edit_reminder_delay"); 238 var _2e=$("todo_edit_reminder_every"); 239 if(_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; 149 247 } 150 248 } … … 187 285 } 188 286 this.list_select_buttons_singular(); 189 },list_show_todo_info:function(_ 1c){190 this.temp_hash=_ 1c;287 },list_show_todo_info:function(_30){ 288 this.temp_hash=_30; 191 289 rubricks.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){290 var _31=rubricks.todo_list.temp_hash; 291 var _32=rubricks.todo_list.todo_list; 292 if(_32){ 293 var _33=_32.getSelected(); 294 if(_33[0]!=_31){ 295 rubricks.todo_list.todo_list.selectEffect(rubricks.todo_list.todo_list.buildTrId(_31)); 296 } 297 if(_31.length>0){ 298 new Ajax.Updater("todo_info",rubricks.todo_list.url_list_show,{asynchronous:true,evalScripts:true,parameters:{id:_31},onLoaded:function(_34){ 299 rubricks.common.rubricks_wait_message_close(); 300 },onLoading:function(_35){ 203 301 rubricks.common.rubricks_wait_message_open(); 204 302 }}); … … 209 307 }); 210 308 }}); 211 AjaxHistory.addCallback(function(_ 22){212 rubricks.todo_list.list_show_todo_info(_ 22);309 AjaxHistory.addCallback(function(_36){ 310 rubricks.todo_list.list_show_todo_info(_36); 213 311 },rubricks.todo_list._ajax_history_prefix); 214 312 components/todo_list/trunk/todo_list/_install/stylesheets/todo.css
r5740 r5761 23 23 width: 100%; 24 24 } 25 th.todo_category_box_title { 26 height: 16px; 27 padding: 4px 0 3px; 28 } 25 29 div.todo_tile { 26 30 border-style: solid; … … 29 33 padding: 3px; 30 34 text-align: left; 31 width: 95%;32 35 } 33 36 table.todo_tile { … … 44 47 width: 75px; 45 48 } 49 div.todo_tile_bg_shared { 50 background-color: #dbedf8; 51 background-image: none; 52 } 53 .todo_tile_dummy { 54 border: none; 55 height: 0px; 56 } 46 57 div.todo_tile_priority_1 { 47 58 border-right: 5px solid #66cc00; … … 54 65 } 55 66 56 /*--[Settings for Progress Bar]-------*/ 57 .todo_progress { 58 font-size: 1px; 59 height: 10px; 60 padding: 0; 67 /*--[Settings for Block]--------------*/ 68 dl.todo_block_list dt { 69 clear: left; 70 float: left; 71 margin-left: -6px; 72 width: 18px; 61 73 } 62 .todo_progress_done{63 background-color: #3366ff;74 dl.todo_block_list dd { 75 margin-left: 18px; 64 76 } 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; 67 82 } 68 .todo_progress_unfinished {69 background-color: #bbbbff;83 *html dl.todo_block_list dd { 84 margin-left: 24px; 70 85 } components/todo_list/trunk/todo_list/admin/_main_read_content.rhtml
r5721 r5761 1 1 <% 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 %> 6 8 <% end %> 7 9 <table class="rubricks_general_table"> components/todo_list/trunk/todo_list/admin/main.rhtml
r5721 r5761 1 1 <div class="rubricks_general_frame_borderless"> 2 2 <% 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> 3 6 <% end %> 4 7 <% render_content_body do %> … … 19 22 rubricks.todo_list.admin_toggle_reminder_flag(); 20 23 </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 8 8 end 9 9 10 def print_content 11 @tlc = TodoList::TodoListConfig.instance 12 render :partial => '/todo_list/admin/main_read_content' 13 end 14 10 15 def update 11 16 begin 12 17 ActiveRecord::Base.transaction do 13 18 @tlc = TodoList::TodoListConfig.instance 14 @tlc.update_attributes ({19 @tlc.update_attributes!({ 15 20 :site_reminder_flag => params[:todo_config][:site_reminder_flag], 16 21 :site_remind_hour => params[:todo_config][:site_remind_hour], … … 22 27 logger.error(ex.message) 23 28 logger.error(ex.backtrace.join("\n ")) 24 flash[:todo_update_error] ='[_TodoList_Admin_ErrorUpdate]'29 raise RubricksError::Common::AjaxError, '[_TodoList_Admin_ErrorUpdate]' 25 30 end 26 flash[:todo_ update_message] = '[_TodoList_Admin_MessageUpdate]'31 flash[:todo_message] = '[_TodoList_Admin_MessageUpdate]' 27 32 rubricks_logger(:action_type => :update, :data => @tlc) 28 33 redirect_to :action => 'main' components/todo_list/trunk/todo_list/block/list.rhtml
r5721 r5761 1 1 <% if @tlt_list.blank? %> 2 <div> 3 <%= hl('[_Common_ListMessage]', hl('[_TodoList_Common_Todo]')) %> 4 </div> 2 5 <% 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> 9 16 <%= 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'}) %> 10 17 <% 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 1 page << %Q|Element.update('todo_block_list_frame', #{simple_render_component('/todo_list/block', 'list', {'page' => @page}).to_json});| 2 page << %Q|if($('todo_area')) {Element.update('todo_area', #{simple_render_component('/todo_list/index', 'show', {}).to_json});}| 3 page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_message])}");| 4 flash[:todo_message] = nil components/todo_list/trunk/todo_list/block_controller.rb
r5721 r5761 8 8 def list 9 9 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') 11 11 end 12 12 … … 15 15 begin 16 16 ActiveRecord::Base.transaction do 17 tlt = TodoList::TodoListTodo.create_or_update_todo(params[:todo])17 @tlt = TodoList::TodoListTodo.create_or_update_todo(params[:todo]) 18 18 end 19 19 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 23 27 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]' 25 30 headers["Content-Type"] = "text/javascript" 26 31 end components/todo_list/trunk/todo_list/common/_todo_input_window.rhtml
r5721 r5761 6 6 <table class="rubricks_general_table"> 7 7 <tr class="rubricks_general_table_even"> 8 <td style="width: 20%;"><%= hl('[_Common_Title]') %></td>8 <td style="width:20%;"><%= hl('[_Common_Title]') %></td> 9 9 <%= validate 'todo_title', [{:required => true}, {:length => '1..30'}] %> 10 <td style="width: 80%;">10 <td style="width:80%;"> 11 11 <%= text_field('todo', 'title', :size => 48, :maxlength => 30, :value => ((tlt.blank?) ? '' : tlt.title), :class => 'input_text_inactive focus') %> 12 12 <div id="todo_title_msg" class="todo_validate_msg"></div> … … 26 26 <td> 27 27 <%= 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"> </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"> </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"> </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"> </span></span> 29 29 <div id="todo_start_on_msg" class="todo_validate_msg"></div> 30 30 <%= rollover_swap('datepicker_todo_start_on_picker_form', 'datepicker_todo_start_on_picker_cancel_form') %> … … 36 36 <td> 37 37 <%= 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"> </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"> </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"> </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"> </span></span> 39 39 <div id="todo_close_on_msg" class="todo_validate_msg"></div> 40 40 <%= rollover_swap('datepicker_todo_close_on_picker_form', 'datepicker_todo_close_on_picker_cancel_form') %> … … 49 49 <td><%= hl('[_TodoList_Common_ThisOrder]') %></td> 50 50 <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> 57 57 </td> 58 58 </tr> … … 61 61 <td> 62 62 <%= 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"> </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]') %>"> </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 %> 64 71 <%= 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"> </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"> </span></span> 81 <%= rollover_swap('todo_allot_to_select_button', 'todo_allot_to_clear_button') %> 65 82 </td> 66 83 </tr> components/todo_list/trunk/todo_list/common_controller.rb
r5721 r5761 6 6 end 7 7 8 def allot_to_window 9 end 10 8 11 def input 9 12 @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 11 19 @url_options = {:controller => ((params[:ctl].blank?) ? '/todo_list/index' : params[:ctl]), :action => ((params[:act].blank?) ? 'update' : params[:act])} 12 20 headers["Content-Type"] = "text/javascript" components/todo_list/trunk/todo_list/common_helper.rb
r5721 r5761 7 7 html = [] 8 8 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"> </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"> </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"> </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"> </span></span>| 11 11 html << hl('[_Common_RangeMark]') 12 12 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"> </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"> </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"> </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"> </span></span>| 15 15 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') 16 16 return html.join('') … … 41 41 end 42 42 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 43 61 def render_todo(tlt) 44 62 render :partial => '/todo_list/index/todo', :locals => {:tlt => tlt} … … 47 65 def render_todo_buttons(tlt) 48 66 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"> </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"> </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"> </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"> </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"> </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"> </span></span>| if tlt.deletable? 52 70 html << rollover_swap("todo_#{tlt.id}_finish_button", "todo_#{tlt.id}_update_button", "todo_#{tlt.id}_delete_button") 53 71 return html.join('') 54 72 end 55 73 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 59 82 else 60 return date.strftime(hl('[_Common_Date_Format]'))83 return options[:date].strftime(hl('[_Common_Date_Format]')) 61 84 end 62 85 end 63 86 64 87 def render_todo_deadline(tlt) 65 html = []66 88 distance = tlt.distance_for_close_on 67 unless distance.nil? 68 html << '<div class="float_right">' 89 if distance.nil? 90 return '' 91 else 69 92 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>| 71 94 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>| 73 96 end 74 html << '</div>'75 97 end 76 return html.join('')77 98 end 78 99 … … 90 111 def render_todo_order(tlt) 91 112 case tlt.this_order 92 when 3113 when TodoList::TodoListTodo::ORDER_VALUE[:high] 93 114 return hl('[_Common_OrderHigh]') 94 when 2115 when TodoList::TodoListTodo::ORDER_VALUE[:middle] 95 116 return hl('[_Common_OrderMiddle]') 96 when 1117 when TodoList::TodoListTodo::ORDER_VALUE[:low] 97 118 return hl('[_Common_OrderLow]') 98 119 end 99 120 end 100 121 101 def render_todo_progress(*args) 102 options = args.flex :count, :width 122 def render_todo_progress(tlt) 103 123 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 113 136 end 114 137 components/todo_list/trunk/todo_list/component_plugins/calendar/init.rb
r4142 r5761 1 1 lib = File.expand_path("#{File.dirname(__FILE__)}/lib") 2 2 require_dependency "#{lib}/todo_list_adapter" 3 4 3 RubricksScheduleManager << TodoList::TodoListAdapter components/todo_list/trunk/todo_list/component_plugins/calendar/lib/todo_list_adapter.rb
r4142 r5761 2 2 class << self 3 3 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} 39 8 end 40 9 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}) 45 12 end 46 13 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%;"' : '' %>> 2 2 <div class="todo_tile_priority_<%= tlt.this_order %>"> 3 3 <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> 4 9 <tr> 5 10 <% if print? %> 6 <td colspan=" 2">11 <td colspan="3"> 7 12 <div class="overflow_auto"> 8 13 <%= hl(tlt.title) %> … … 10 15 </td> 11 16 <% else %> 12 <td class="todo_tile_buttons" >17 <td class="todo_tile_buttons" style="width:74px;"> 13 18 <%= render_todo_buttons(tlt) %> 14 19 </td> 15 <td c lass="overflow_auto">20 <td colspan="2"> 16 21 <div class="overflow_auto"> 17 22 <%= hl(tlt.title) %> … … 22 27 <tr> 23 28 <td> 24 <%= render_todo_progress(tlt .progress) %>29 <%= render_todo_progress(tlt) %> 25 30 </td> 26 31 <td> 32 <span id="todo_progress_text_<%= tlt.id %>"><%= tlt.progress %></span>% 33 </td> 34 <td class="text_right"> 27 35 <%= render_todo_deadline(tlt) %> 28 <%= tlt.progress %>%36 <%= render_share_info(tlt) %> 29 37 </td> 30 38 </tr> components/todo_list/trunk/todo_list/index/main.rhtml
r5722 r5761 1 1 <div class="rubricks_general_frame_borderless"> 2 2 <% render_operation_bar do %> 3 <% form_tag({:controller => '/todo_list/index', :action => 'print', :p age=> '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 %> 4 4 <span id="print_button" class="buttons darkicon_print textcolor_white" onclick="rubricks.todo_list.index_print();"><%= hl('[_Common_Print]') %></span> 5 5 <% end %> 6 6 <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> 8 8 </div> 9 9 <% end %> … … 18 18 <% end %> 19 19 </div> 20 <div id="todo_category_edit_window_frame"></div> components/todo_list/trunk/todo_list/index/show.rhtml
r5740 r5761 3 3 <tr> 4 4 <% @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"> </span></span></th> 6 6 <% end %> 7 7 </tr> … … 21 21 </tbody> 22 22 </table> 23 <% @tlcb_list.each do |tlcb| %> 24 <%= rollover_swap("todo_category_#{tlcb.id}_title_edit_button") %> 25 <% end %> 23 26 <%= 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']) %> 24 27 <%= 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 1 page << %Q|Element.update('todo_area', #{simple_render_component('/todo_list/index', 'show', {}).to_json});| 2 page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_message])}");| 3 flash[:todo_message] = nil components/todo_list/trunk/todo_list/index_controller.rb
r5721 r5761 2 2 define_page 3 3 uses_component_template_root 4 helper :'todo_list/common' 4 helper :'todo_list/common' 5 before_filter :refuse_guest 5 6 6 7 def main 7 8 @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]) 9 26 end 10 27 … … 17 34 logger.error(ex.message) 18 35 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]' 20 50 end 21 51 render :nothing => true … … 32 62 logger.error(ex.message) 33 63 logger.error(ex.backtrace.join("\n ")) 34 flash[:todo_update_error] ='[_TodoList_Common_ErrorDelete]'64 raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorDelete]' 35 65 end 36 flash[:todo_ update_message] = '[_TodoList_Common_MessageDelete]'66 flash[:todo_message] = '[_TodoList_Common_MessageDelete]' 37 67 headers["Content-Type"] = "text/javascript" 38 68 render :template => '/todo_list/index/update.rjs' … … 47 77 logger.error(ex.message) 48 78 logger.error(ex.backtrace.join("\n ")) 49 flash[:todo_update_error] ='[_TodoList_Common_ErrorUpdate]'79 raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUpdate]' 50 80 end 51 81 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]' 53 83 headers["Content-Type"] = "text/javascript" 54 84 render :template => '/todo_list/index/update.rjs' … … 56 86 57 87 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}) 59 89 end 60 90 61 91 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}) 63 94 end 64 95 65 96 def update 66 97 begin 98 flash[:todo_message] = '[_TodoList_Common_MessageCreate]' if params[:todo][:id].blank? 67 99 ActiveRecord::Base.transaction do 68 100 @tlt = TodoList::TodoListTodo.create_or_update_todo(params[:todo]) 69 101 end 70 102 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 74 111 end 75 112 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]' 77 114 headers["Content-Type"] = "text/javascript" 78 115 render :template => '/todo_list/index/update.rjs' components/todo_list/trunk/todo_list/languages/english.rb
r5721 r5761 5 5 '_TodoList_Admin_MessageUpdate' => 'todo configs are updated.', 6 6 '_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', 7 11 '_TodoList_Common_CloseOn' => 'Closing date', 8 12 '_TodoList_Common_DeadlineAfter' => '%d day(s) after', 9 13 '_TodoList_Common_DeadlineBefore' => '%d day(s) before', 10 14 '_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.', 11 17 '_TodoList_Common_ErrorCreate' => 'Failed to create the task.', 12 18 '_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.', 13 20 '_TodoList_Common_ErrorTodoNotSelected' => 'Any task is not selected.', 21 '_TodoList_Common_ErrorUneditable' => 'Failed to access the task. Please refresh the screen and try again.', 14 22 '_TodoList_Common_ErrorUpdate' => 'Failed to update the task.', 15 23 '_TodoList_Common_InputWindowTitle' => 'ToDo Input Window', 24 '_TodoList_Common_MessageCategoryUpdate' => 'A title of the category is updated.', 16 25 '_TodoList_Common_MessageCreate' => 'The task is created.', 17 26 '_TodoList_Common_MessageDelete' => 'The task is deleted.', 18 27 '_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.', 19 30 '_TodoList_Common_MessageRevertConfirm' => 'Are you sure to revert this task?', 20 31 '_TodoList_Common_MessageUpdate' => 'The task is updated.', 32 '_TodoList_Common_MessageUpdatePendingApproval' => 'The task is updated. It will be finished when the owner approve.', 21 33 '_TodoList_Common_Progress' => 'Progress', 22 34 '_TodoList_Common_Reminder' => 'Reminder', … … 24 36 '_TodoList_Common_RemindOptionAtOnce' => 'At Once', 25 37 '_TodoList_Common_RemindOptionEveryday' => 'Everyday', 38 '_TodoList_Common_SendReminder' => 'Send Reminder', 26 39 '_TodoList_Common_SendReminderAtOnce' => 'Send remind mail at %s', 27 40 '_TodoList_Common_SendReminderEveryday' => 'Send remind mail everyday from %s', 28 '_TodoList_Common_SendReminder' => 'Send Reminder',29 41 '_TodoList_Common_StartOn' => 'Starting date', 30 42 '_TodoList_Common_ThisOrder' => 'Priority', … … 33 45 '_TodoList_Common_TodoDetail' => 'ToDo Detail', 34 46 '_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', 36 52 '_TodoList_Filter_TargetOptionCompleted' => 'Completed', 37 53 '_TodoList_Filter_TargetOptionUncompleted' => 'Uncompleted', components/todo_list/trunk/todo_list/languages/japanese.rb
r5721 r5761 2 2 def define_lang 3 3 lang('japanese').merge!({ 4 '_TodoList_Admin_ErrorUpdate' => 'To doèšå®ã®æŽæ°ã«å€±æããŸããã',5 '_TodoList_Admin_MessageUpdate' => 'To doèšå®ãæŽæ°ããŸããã',4 '_TodoList_Admin_ErrorUpdate' => 'ToDoèšå®ã®æŽæ°ã«å€±æããŸããã', 5 '_TodoList_Admin_MessageUpdate' => 'ToDoèšå®ãæŽæ°ããŸããã', 6 6 '_TodoList_Admin_RemindTime' => 'ãªãã€ã³ãã¡ãŒã«éä¿¡æå»', 7 '_TodoList_Common_Allot' => 'å²åœ', 8 '_TodoList_Common_AllotFrom' => 'ã%sãããå²åœ', 9 '_TodoList_Common_AllotTo' => 'ã%sãã«å²åœ', 10 '_TodoList_Common_CategoryWindowTitle' => 'ã«ããŽãªåç·šé', 7 11 '_TodoList_Common_CloseOn' => 'å®äºäºå®æ¥', 8 12 '_TodoList_Common_DeadlineAfter' => 'ç· å%dæ¥è¶ … … 10 14 '_TodoList_Common_DeadlineBefore' => 'ç· å%dæ¥å', 11 15 '_TodoList_Common_DeadlineJust' => 'æ¬æ¥ç· å', 16 '_TodoList_Common_ErrorAllotToCreator' => 'ToDoãäœæè 17 èªèº«ã«å²åœããããšã¯ã§ããŸããã', 18 '_TodoList_Common_ErrorCategoryUpdate' => 'ã«ããŽãªåã®æŽæ°ã«å€±æããŸããã', 12 19 '_TodoList_Common_ErrorCreate' => 'ToDoã®æ°èŠäœæã«å€±æããŸããã', 13 20 '_TodoList_Common_ErrorDelete' => 'ToDoã®åé€ã«å€±æããŸããã', 21 '_TodoList_Common_ErrorReturnByOther' => 'ToDoäœæè 22 以å€ãå·®ãæ»ãããšã¯ã§ããŸããã', 14 23 '_TodoList_Common_ErrorTodoNotSelected' => 'ToDoãéžæãããŠããŸããã', 24 '_TodoList_Common_ErrorUneditable' => 'æå®ãããToDoãåç 25 §ããããšãã§ããŸããã該åœToDoã®é²èŠ§ã»æŽæ°æš©éããªããªã£ãå¯èœæ§ããããŸããç»é¢ãæŽæ°ããŠããçŽããŠãã ããã', 15 26 '_TodoList_Common_ErrorUpdate' => 'ToDoã®æŽæ°ã«å€±æããŸããã', 16 27 '_TodoList_Common_InputWindowTitle' => 'ToDoå 17 28 ¥åç»é¢', 29 '_TodoList_Common_MessageCategoryUpdate' => 'ã«ããŽãªåãæŽæ°ããŸããã', 18 30 '_TodoList_Common_MessageCreate' => 'ToDoãæ°èŠäœæããŸããã', 19 31 '_TodoList_Common_MessageDelete' => 'ToDoãåé€ããŸããã', 20 32 '_TodoList_Common_MessageFinishConfirm' => 'ã¿ã¹ã¯ãå®äº(鲿ç100%)ã«ããŸããããããã§ããïŒ', 33 '_TodoList_Common_MessageNeedApproval' => 'â» ãã®ãŸãŸä¿åããããšã§å®äºãšãªããŸãã', 34 '_TodoList_Common_MessagePendingApproval' => 'â» ToDoäœæè 35 ã®æ¿èªåŸãå®äºãšãªããŸãã', 21 36 '_TodoList_Common_MessageRevertConfirm' => 'ã¿ã¹ã¯ãæªå®äº(鲿ç90%)ã«ããŸããããããã§ããïŒ', 22 37 '_TodoList_Common_MessageUpdate' => 'ToDoãæŽæ°ããŸããã', 38 '_TodoList_Common_MessageUpdatePendingApproval' => 'ToDoãæŽæ°ããŸãããToDoäœæè 39 ã®æ¿èªåŸãå®äºãšãªããŸãã', 40 '_TodoList_Common_NotAllotted' => 'æªå²åœ', 23 41 '_TodoList_Common_Progress' => '鲿ç', 24 42 '_TodoList_Common_Reminder' => 'ToDoãªãã€ã³ã', … … 36 54 '_TodoList_Common_TodoDetail' => 'ToDo詳现', 37 55 '_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' => 'å®äºã»æªå®äº', 40 66 '_TodoList_Filter_TargetOptionCompleted' => 'å®äºã®ã¿', 41 67 '_TodoList_Filter_TargetOptionUncompleted' => 'æªå®äºã®ã¿', … … 44 70 ã¡ã¿ã¹ã¯', 45 71 '_TodoList_Index_LabelPriority3' => '察å¿äžã¿ã¹ã¯', 46 '_TodoList_Info_BlockDescList' => 'To doãããã¯',47 '_TodoList_Info_BlockTitleList' => 'To doãããã¯',72 '_TodoList_Info_BlockDescList' => 'ToDoãããã¯', 73 '_TodoList_Info_BlockTitleList' => 'ToDoãããã¯', 48 74 '_TodoList_Info_Description' => 'ToDoã®ç®¡çãè¡ãã³ã³ããŒãã³ãã§ãã', 49 75 '_TodoList_Info_DisplayName' => 'ToDo', 50 76 '_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 šä»¶äžèЧ', 53 80 '_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 šä»¶äžèЧ', 56 84 '_TodoList_Info_TrailRead' => 'ToDoã®é²èЧ', 57 85 '_TodoList_Info_TrailUpdate' => 'ToDoã®ç»é²ã»æŽæ°ã»åé€', components/todo_list/trunk/todo_list/list/_main_filter.rhtml
r5740 r5761 1 1 <% 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 %> 2 2 <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"> 4 6 <select id="todo_filter_target" name="todo_filter[target]"> 7 <option value="all"><%= hl('[_TodoList_Filter_TargetOptionAll]') %></option> 5 8 <option value="uncompleted"><%= hl('[_TodoList_Filter_TargetOptionUncompleted]') %></option> 6 9 <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> 8 16 </select> 9 17 </div> components/todo_list/trunk/todo_list/list/_show_edit_content.rhtml
r5722 r5761 60 60 </td> 61 61 </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"> </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"> </span></span> 69 <%= rollover_swap('todo_edit_allot_to_select_button', 'todo_edit_allot_to_clear_button') %> 70 </td> 71 </tr> 62 72 </table> 63 73 <script type="text/javascript"> 74 rubricks.todo_list.list_todo_edit_allot_to_value = <%= (ru.blank?) ? %q|''| : %Q|value="#{ru.id}"| %>; 64 75 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');}); 65 76 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 10 10 <tr class="rubricks_general_table_even"> 11 11 <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> 13 13 </tr> 14 14 <tr class="rubricks_general_table_even"> 15 15 <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> 17 17 </tr> 18 18 <tr class="rubricks_general_table_even"> … … 22 22 <tr class="rubricks_general_table_even"> 23 23 <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> 25 40 </tr> 26 41 </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 1 page << %Q|Element.update('todo_list_frame', #{simple_render_component('/todo_list/list', 'list', {}).to_json});| 2 page << %Q|rubricks.todo_list.list_detail_area_hide();| 3 page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_message])}");| 4 flash[:todo_message] = nil components/todo_list/trunk/todo_list/list/list.rhtml
r5722 r5761 23 23 <% @tlt_list.each do |tlt| %> 24 24 <% 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 %> 25 30 <% render_selectable_td do %> 26 31 <div class="overflow_auto"><%= hl(tlt.title) %></div> components/todo_list/trunk/todo_list/list/main.rhtml
r5722 r5761 1 1 <div class="rubricks_general_frame_borderless"> 2 2 <% render_operation_bar do %> 3 <% form_tag({:controller => '/todo_list/list', :action => 'print', :p age=> '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 %> 4 4 <input type="hidden" id="todo_print_id" name="id" value="" /> 5 5 <span id="print_button" class="buttons disabled darkicon_print textcolor_white" onclick="rubricks.todo_list.list_print();"><%= hl('[_Common_Print]') %></span> 6 6 <% end %> 7 7 <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> 9 9 </div> 10 10 <% end %> components/todo_list/trunk/todo_list/list/show.rhtml
r5722 r5761 4 4 <% render_detail('01', '[_TodoList_Common_TodoDetail]') do %> 5 5 <% 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 %> 9 11 <div id="todo_edit_mode_form" class="float_button_right_inactive swap"> 10 12 <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 1 page << %Q|Element.update('todo_list_frame', #{simple_render_component('/todo_list/list', 'list', {:id => @tlt.id}).to_json});| 2 page << %Q|Element.update('todo_info', #{simple_render_component('/todo_list/list', 'show', {:id => @tlt.id}).to_json});| 3 page << %Q|rubricks.common.rubricks_feedback_msg.add("#{hl(flash[:todo_message])}");| 4 flash[:todo_message] = nil components/todo_list/trunk/todo_list/list_controller.rb
r5721 r5761 2 2 define_page 3 3 uses_component_template_root 4 helper :'todo_list/common' 4 helper :'todo_list/common' 5 before_filter :refuse_guest 5 6 6 7 def main … … 16 17 logger.error(ex.message) 17 18 logger.error(ex.backtrace.join("\n ")) 18 flash[:todo_update_error] ='[_TodoList_Common_ErrorCreate]'19 raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorCreate]' 19 20 end 20 21 rubricks_logger({:action_type => :create, :data => @tlt}) 21 flash[:todo_ update_message] = '[_TodoList_Common_MessageCreate]'22 flash[:todo_message] = '[_TodoList_Common_MessageCreate]' 22 23 headers["Content-Type"] = "text/javascript" 23 24 render :template => '/todo_list/list/update.rjs' … … 36 37 logger.error(ex.message) 37 38 logger.error(ex.backtrace.join("\n ")) 38 flash[:todo_update_error] ='[_TodoList_Common_ErrorDelete]'39 raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorDelete]' 39 40 end 40 flash[:todo_ update_message] = '[_TodoList_Common_MessageDelete]'41 flash[:todo_message] = '[_TodoList_Common_MessageDelete]' 41 42 headers["Content-Type"] = "text/javascript" 42 43 render :template => '/todo_list/list/delete.rjs' … … 48 49 filter_conditions = filter_merge_conditions({:input_data => params[:todo_filter], :page => params[:page].to_i}) 49 50 @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) 51 52 @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') 53 54 rubricks_logger({:action_type => :list, :data => @tlt_list}) 54 55 end … … 57 58 @tlc = TodoList::TodoListConfig.instance 58 59 @tlt = TodoList::TodoListTodo.find(params[:id]) 60 raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUneditable]' unless @tlt.editable? 59 61 end 60 62 … … 63 65 @tlc = TodoList::TodoListConfig.instance 64 66 @tlt = TodoList::TodoListTodo.find(params[:id]) 67 raise RubricksError::Common::AjaxError, '[_TodoList_Common_ErrorUneditable]' unless @tlt.editable? 65 68 rubricks_logger({:action_type => :detail, :data => @tlt}) 66 69 else … … 75 78 end 76 79 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 80 87 end 81 88 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]' 83 90 headers["Content-Type"] = "text/javascript" 84 91 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' %> 2 2 <%= javascript_include_tag '/javascripts/components/todo_list/todo' %> 3 3 <script type="text/javascript"> 4 4 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') %>' 14 18 }); 15 19 </script> 16 <% render_window('todo_input_window', 'rubricks.todo_list.todo_input_window', '[_TodoList_Common_InputWindowTitle]', {:width => 640, :height => 5 10, :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 %> 17 21 <div id="todo_input_window_contents"></div> 18 22 <% end %> 23 <div id="todo_allot_to_window_frame"></div> components/todo_list/trunk/todo_list/todo_list_category_box.rb
r5721 r5761 1 1 class TodoList::TodoListCategoryBox < ActiveRecord::Base 2 2 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 4 5 belongs_to :rubricks_user 5 validates_length_of :title, :in => 1..156 validates_numericality_of :box_no, :only_integer => true7 validates_inclusion_of :box_no, :in=>1..36 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 8 9 9 10 unless defined? BOX_NUMBERS … … 12 13 13 14 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'}) 16 17 if tlcb_list.blank? 17 18 tlcb_list = [] 18 19 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 20 24 end 21 25 end … … 25 29 26 30 def current_todos 27 TodoList::TodoListTodo.find(:all, :conditions => ['todo_list_ category_box_id = ? and closed_on is null', self.id], :order => 'order_in_boxasc')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') 28 32 end 29 33 end components/todo_list/trunk/todo_list/todo_list_config.rb
r5721 r5761 9 9 class << self 10 10 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) 12 12 end 13 13 end components/todo_list/trunk/todo_list/todo_list_lib.rb
r5721 r5761 1 1 class 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 2 9 class << self 3 10 def deadline_message(distance) components/todo_list/trunk/todo_list/todo_list_todo.rb
r5738 r5761 2 2 unless defined? DEADLINE_CAUTION 3 3 DEADLINE_CAUTION = 5 4 ORDER_ MAX = 655354 ORDER_VALUE = {:high => 3, :middle => 2, :low => 1} 5 5 PROGRESS_RANGE = [0,10,20,30,40,50,60,70,80,90,100] 6 6 end 7 7 8 8 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 10 11 validates_bool_of :reminder_flag 11 12 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 30 30 31 31 class << self … … 35 35 input_data[:id] = tlt.id 36 36 end 37 tlt = self.find(input_data[:id] , :include => :todo_list_category_box)37 tlt = self.find(input_data[:id]) 38 38 tlt.update_todo(input_data) 39 39 return tlt … … 41 41 42 42 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 48 47 end 49 48 50 49 def filter_merge_conditions(filter_conditions_hash) 51 50 filter_conditions, query, conditions = {}, [], [] 52 query << 'todo_list_category_box _id in (?)'51 query << 'todo_list_category_boxes.id in (?)' 53 52 conditions << TodoList::TodoListCategoryBox.find_or_create_boxes(RubricksLib.current_user.id).map{|tlcb| tlcb.id} 54 53 case filter_conditions_hash[:target] 55 when 'all'56 54 when 'completed' 57 55 query << 'closed_on is not null' 58 else56 when 'uncompleted' 59 57 query << 'closed_on is null' 60 58 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 61 70 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) 66 74 end 67 75 date_range = RubricksLib.dates_to_range(filter_conditions_hash[:start_on], filter_conditions_hash[:close_on]) … … 109 117 filter_conditions_hash[:word] = input_data[:word] unless input_data[:word].nil? 110 118 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? 111 120 filter_conditions_hash[:start_on] = input_data[:start_on] unless input_data[:start_on].nil? 112 121 filter_conditions_hash[:close_on] = input_data[:close_on] unless input_data[:close_on].nil? … … 127 136 128 137 def finish_todo(id) 138 self.progress(id, PROGRESS_RANGE.last) 139 end 140 141 def progress(id, progress) 129 142 tlt = self.find(id) 130 tlt.update_todo({:progress => PROGRESS_RANGE.last})143 tlt.update_todo({:progress => progress, :ignore_share => true}) 131 144 end 132 145 … … 135 148 unless options[:tlt_id_list].nil? 136 149 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 142 160 end 143 161 … … 152 170 end 153 171 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 154 187 def remind_unwanted? 155 188 if(Time.now >= Time.at(self.close_on - self.reminder_delay.day)) … … 159 192 end 160 193 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}) 161 256 end 162 257 … … 166 261 self.start_on = input_data[:start_on] unless input_data[:start_on].nil? 167 262 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? 171 264 self.progress = input_data[:progress] unless input_data[:progress].blank? 172 set_c ategory265 set_closed_on(input_data) 173 266 set_reminder(input_data) 174 267 self.save! 268 TodoList::TodoListTodoLink.share(self, input_data[:allot_to]) if input_data[:ignore_share].blank? 175 269 return self 176 270 end 177 271 178 def validate179 raise_if_invalid_user180 end181 182 272 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 189 286 end 190 287
