diff --git a/sai/modules/saimod_sys_text/js/saimod_sys_text.js b/sai/modules/saimod_sys_text/js/saimod_sys_text.js index 0645d47..9698851 100644 --- a/sai/modules/saimod_sys_text/js/saimod_sys_text.js +++ b/sai/modules/saimod_sys_text/js/saimod_sys_text.js @@ -88,6 +88,7 @@ function init_saimod_sys_text_editor(){ }; function init_tinymce(){ + tinymce.remove(); tinymce.init({ // General options /* formats : { diff --git a/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js b/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js index f87c22c..17e2600 100644 --- a/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js +++ b/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js @@ -24,6 +24,7 @@ function init_saimod_sys_todo_todo() { $('#tabs_todo li').each(function(){ $(this).removeClass('active');}); $('#menu_todolist').parent().addClass('active'); + init_tinymce(); } function init_saimod_sys_todo_doto() { @@ -41,7 +42,7 @@ function init_saimod_sys_todo_stats() { function init_saimod_sys_todo_todoopen(){ $('#btn_edit').click(function(){ $.ajax({ type : 'GET', - url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent($('#ta_message').val()), + url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent(tinyMCE.activeEditor.getContent({format : 'raw'})), success : function(data) { if(data.status){ system.load('todo'); @@ -53,11 +54,12 @@ function init_saimod_sys_todo_todoopen(){ register_assign(); register_deassign(); register_deassign_user(); + init_tinymce(); } function init_saimod_sys_todo_todoclose(){ $('#btn_edit').click(function(){ $.ajax({ type : 'GET', - url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent($('#ta_message').val()), + url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent(tinyMCE.activeEditor.getContent({format : 'raw'})), success : function(data) { if(data.status){ system.load('todo'); @@ -69,12 +71,13 @@ function init_saimod_sys_todo_todoclose(){ register_assign(); register_deassign(); register_deassign_user(); + init_tinymce(); } function init_saimod_sys_todo_new(){ $('#btn_add').click(function(){ $.ajax({ type : 'GET', - url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=add&todo='+encodeURIComponent($('#input_message').val()), + url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=add&todo='+encodeURIComponent(tinyMCE.activeEditor.getContent({format : 'raw'})), success : function(data) { if(data.status){ system.load('todo'); @@ -83,6 +86,7 @@ function init_saimod_sys_todo_new(){ }); }) $('#input_message').focus(); + init_tinymce(); } function register_open(){ @@ -154,4 +158,83 @@ function register_deassign_user(){ } }); }); -} \ No newline at end of file +} + +function init_tinymce(){ + tinymce.remove(); + tinymce.init({ // General options + /* + formats : { + italic : {inline : 'span', 'classes' : 'italic'}}, + // Theme options + theme_modern_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", + theme_modern_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", + theme_modern_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", + theme_modern_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", + theme_modern_toolbar_location : "top", + theme_modern_toolbar_align : "left", + theme_modern_statusbar_location : "bottom", + theme_modern_resizing : true, + + // Example content CSS (should be your site CSS) + content_css : "../../page/index.css"*/ + // General options +/* mode : "textareas", + + plugins : "autolink,lists,pagebreak,layer,table,save,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,template,code",*/ + //xhtmlxtras,emotions,advimage,advlink,iespell,inlinepopups,advhr,style,spellchecker, + + // Theme options + /*theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", + theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", + theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", + theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "bottom", + theme_advanced_resizing : true,*/ + + // Skin options + //skin : "o2k7", + //skin_variant : "silver", + width: "99%", + height: "250px", + + // Example content CSS (should be your site CSS) + //content_css : "css/example.css", + //content_css : "../../page/index.css" + + // Drop lists for link/image/media/template dialogs + /*template_external_list_url : "js/template_list.js", + external_link_list_url : "js/link_list.js", + external_image_list_url : "js/image_list.js", + media_external_list_url : "js/media_list.js", + + // Replace values for the template plugin + template_replace_values : { + username : "Some User", + staffid : "991234" + }*/ + + selector: "textarea", + theme: "modern", + //theme : "advanced", + plugins: [ + "advlist autolink lists link image charmap print preview hr anchor pagebreak", + "searchreplace wordcount visualblocks visualchars code fullscreen", + "insertdatetime media nonbreaking save table contextmenu directionality", + "emoticons template paste textcolor" + ], + toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", + toolbar2: "print preview media | forecolor backcolor emoticons", + image_advtab: true, + templates: [ + {title: 'Test template 1', content: 'Test 1'}, + {title: 'Test template 2', content: 'Test 2'} + ], + //remove p tag + forced_root_block : "", + force_br_newlines : true, + force_p_newlines : false +}); +} diff --git a/sai/modules/saimod_sys_todo/saimod_sys_todo.php b/sai/modules/saimod_sys_todo/saimod_sys_todo.php index b2b0d04..2432f7b 100644 --- a/sai/modules/saimod_sys_todo/saimod_sys_todo.php +++ b/sai/modules/saimod_sys_todo/saimod_sys_todo.php @@ -80,15 +80,17 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { public static function statistics(){ $result = array(); $result['project'] = 0; - $result['project_count'] = 0; + $result['project_closed'] = 0; + $result['project_open'] = 0; $result['project_all'] = 0; $result['data'] = array(); foreach(self::$stats as $stat){ $data = \call_user_func(array($stat, 'stats')); $result['data'][] = $data; $result['project'] += $data->perc; - $result['project_count'] += $data->part; - $result['project_all'] += $data->whole; + $result['project_open'] += $data->open; + $result['project_closed'] += $data->closed; + $result['project_all'] += $data->all; } $result['project'] = round($result['project'] / (count($result['data'])),2); return $result; diff --git a/sai/modules/saimod_sys_todo/todo_stats_data.php b/sai/modules/saimod_sys_todo/todo_stats_data.php index b05d53a..4f23655 100644 --- a/sai/modules/saimod_sys_todo/todo_stats_data.php +++ b/sai/modules/saimod_sys_todo/todo_stats_data.php @@ -2,13 +2,15 @@ namespace SYSTEM\SAI; class todo_stats_data { var $name = ''; - var $part = 0; - var $whole = 1; + var $open = 0; + var $closed = 0; + var $all = 1; var $perc = 0; - public function __construct($name='',$part=0,$whole=1) { + public function __construct($name='',$closed=0,$all=1) { $this->name = $name; - $this->part = $part; - $this->whole = $whole; - $this->perc = round($this->part / $this->whole * 100,2); + $this->open = $all-$closed; + $this->closed = $closed; + $this->all = $all; + $this->perc = round($this->closed / $this->all * 100,2); } } diff --git a/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl b/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl index 52cb7a3..80518eb 100644 --- a/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl +++ b/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl @@ -1,19 +1,20 @@ - + + ${entries} - + +
${table_name}${table_count}${table_open}${table_closed} ${table_all} ${table_done}
${table_project}${project_count}${project_open}${project_closed} ${project_all} ${project}%
- diff --git a/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl b/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl index aa258bc..66f922a 100644 --- a/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl +++ b/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl @@ -1,6 +1,7 @@ - - - + + + + \ No newline at end of file
${table_username}
${name}${part}${whole}${name}${open}${closed}${all} ${perc}%