tinymce init bugfix, statistics other part, renames etc
This commit is contained in:
parent
4a1a8839cf
commit
3917a19dfc
@ -88,6 +88,7 @@ function init_saimod_sys_text_editor(){
|
||||
};
|
||||
|
||||
function init_tinymce(){
|
||||
tinymce.remove();
|
||||
tinymce.init({ // General options
|
||||
/*
|
||||
formats : {
|
||||
|
||||
@ -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(){
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +1,20 @@
|
||||
<table class="table table-hover table-condensed sai_table" style="width: 100%">
|
||||
<tr>
|
||||
<th>${table_name}</th>
|
||||
<th>${table_count}</th>
|
||||
<th>${table_open}</th>
|
||||
<th>${table_closed}</th>
|
||||
<th>${table_all}</th>
|
||||
<th>${table_done}</th>
|
||||
</tr>
|
||||
${entries}
|
||||
<tr>
|
||||
<td>${table_project}</td>
|
||||
<td>${project_count}</td>
|
||||
<td>${project_open}</td>
|
||||
<td>${project_closed}</td>
|
||||
<td>${project_all}</td>
|
||||
<td>${project}%</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table table-hover table-condensed sai_table" style="width: 100%">
|
||||
<tr>
|
||||
<th>${table_username}</th>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<tr>
|
||||
<td>${name}</td>
|
||||
<td>${part}</td>
|
||||
<td>${whole}</td>
|
||||
<td>${name}</td>
|
||||
<td>${open}</td>
|
||||
<td>${closed}</td>
|
||||
<td>${all}</td>
|
||||
<td>${perc}%</td>
|
||||
</tr>
|
||||
Loading…
x
Reference in New Issue
Block a user