diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index bb676e1e3..7f4a49dc3 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -143,6 +143,16 @@ if ( LOGINPUT)
fwrite($file_loginput,"include '".basename(__FILE__)."';\n");
fclose($file_loginput);
}
+
+/**
+ * for widget we call immediately a file outside the ajax folder
+ */
+if ($op == 'widget') {
+ session_write_close();
+ require_once NOALYSS_INCLUDE.'/widget/ajax.php';
+ return;
+}
+
$path = array(
// search accounting , detail ...
"account"=>"ajax_poste",
diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css
index 186268a2b..940c1606c 100644
--- a/html/css/style-classic7.css
+++ b/html/css/style-classic7.css
@@ -405,9 +405,7 @@ tr.odd > td,tr.even > td {
tr.highlight {
font-weight: bold;
}
-div.even,tr.even {
- /*! background-color: #F7F8FC; */
-}
+
td.odd{
background-color:#DDE6FF;
}
@@ -813,7 +811,7 @@ div.content div.pc_calendar tr{
}
@media only screen and (min-width: 640px) {
div.pc_calendar tr{
- height:110px;
+ height:10%;
}
}
@media only screen and (max-width: 640px) {
@@ -1449,6 +1447,12 @@ h2.title {
font-family: OpenSansRegular;
margin-bottom: 1px;
}
+
+ .box h2.title {
+ font-size: 1rem;
+ font-variant-caps: normal;
+ }
+
h3.title {
color: #0000FF;
margin-left: 30px;
@@ -1802,9 +1806,6 @@ div.box {
font-size:0.90rem;
border-radius:5px;
width:97%;
- margin:1% 1.5% 1% 1.5%;
- margin-right:2px
-
}
/* SM */
@media (min-width: 576px) {
@@ -1819,16 +1820,17 @@ div.box {
@media (min-width: 992px) {
div.box {
width: 46%;
- margin: 1.5%;
+ height:40%;
}
}
/* XL */
@media (min-width: 1200px) {
div.box {
- width: 32.8%;
- margin: 0.2%;
+ width: 35rem;
+ max-height: 30%;
+ height: 45vh;
}
}
@@ -1836,14 +1838,18 @@ div.box {
div.box table{
border-spacing:0px;
font-size: 96%;
+ width: 80%;
}
-div.box tr.odd {
- background-color: lightblue;
-
+div.odd, div.box tr.odd {
+ background-color: #dce7f5;
+ border: 1px solid whitesmoke;
+ padding:2px;
+
}
-div.box tr.even {
+div.even ,div.box tr.even {
background-color: white;
-
+ border: 1px solid whitesmoke;
+ padding:2px;
}
#jrn_name_div h2{
font-size:38.4px;
@@ -3462,4 +3468,98 @@ li.li-active {
.hoverclass-drag {
background-color: white;
+ }
+
+
+ /**********************************************************************************************************************
+ * User's widget list
+ *
+ *********************************************************************************************************************/
+ #widget_box_id {
+ #widget_box_id {
+ width: 100%;
+ margin-left: 0px;
+ margin-right: 0px;
+ }
+ }
+
+ #contain_widget li {
+ padding : 0.75rem;
+ margin:2px;
+ border:navy solid 1px;
+ }
+
+ #widget_add li {
+ padding : 0.75rem;
+ margin:2px;
+ border:navy solid 1px;
+ }
+
+
+ @media (min-width: 576px) {
+
+
+ }
+ /* MeDium */
+ @media (min-width: 768px) {
+ #widget_box_id {
+ width: 100%;
+ margin-left: 0px;
+ margin-right: 0px;
+ }
+ }
+
+ /* LarGe */
+ @media (min-width: 992px) {
+ #widget_box_id {
+ width: 70%;
+ margin-left: 15%;
+
+ }
+ }
+ /* eXtraLarge */
+ @media (min-width: 1200px) {
+
+ }
+span.widget-name {
+ font-size:105%;
+ font-family: bold;
+ font-stretch: extra-expanded;
+ margin-right: 2rem;
+ margin-top: -5px;
+ width: 5rem;
+ display: inline-block;
+
+}
+
+ #dashboard_div_id {
+ margin-top:2vh;
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: center;
+ row-gap: 20px;
+ column-gap: 20px;
+ }
+
+ /*
+ * WIDGET
+ */
+ #widget_box_select_id {
+ max-width: 70rem;
+ }
+ #widget_box_id {
+ max-width: 70rem;
+
+ }
+ .widget_param {
+ font-size: 105%;
+ font-weight: bold;
+ font-style: inherit;
+ border-width: 1px;
+ display: inline-block;
+ border-color: navy;
+ padding: 5px;
+ border-style: groove;
+ margin: 2px;
}
\ No newline at end of file
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index e21663ea0..2b2ec4dcb 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -2886,11 +2886,11 @@ function calendar_zoom(obj) {
obj.outdiv = 'calendar_zoom_div';
}
if ($(obj.outdiv) == undefined) {
- var str_style = 'top:10%;margin-left:2%;';
+ var str_style = 'top:10%;min-height:60rem';
// var str_style = fixed_position(0, 120);
add_div({
id: obj.outdiv,
- style: 'margin-left:3%;width:94%;' + str_style,
+ style: 'width:94%;' + str_style,
cssclass: "inner_box",
drag: 0
});
@@ -4323,3 +4323,270 @@ function activate_plugin(elt)
alert_box(e.message);
}
}
+/**********************************************************************************************************************/
+/**
+ * @class Widget
+ */
+/**********************************************************************************************************************/
+
+Widget = function(dossier_id) {
+ this.dossier_id=dossier_id;
+}
+/**
+ * Display the widget in the elt box
+ * @param box DOMID of the target
+ * @param dossier_id
+ * @param user_widget_id
+ * @param widget_code
+ */
+Widget.prototype.display = function (box,user_widget_id,widget_code) {
+ try {
+
+ var queryString = {
+ gDossier: this.dossier_id,
+ 'op': 'widget',
+ 'user_widget_id': user_widget_id,
+ 'widget_code': widget_code,
+ 'action': 'widget.display'
+ }
+ var action = new Ajax.Request(
+ "ajax_misc.php",
+ {
+ method: 'GET',
+ parameters: queryString,
+ onFailure: ajax_misc_failure,
+ onSuccess: function (req) {
+ if (req.responseText == 'NOCONX') {
+ reconnect();
+ return;
+ }
+ $(box).replace(req.responseText);
+
+ }
+ }
+ );
+ } catch (e) {
+ alert_box(e.message);
+ }
+
+}
+
+/**
+ * Manage the widget
+ * @param dossier_id
+ * @returns {boolean}
+ */
+Widget.prototype.manage = function () {
+ try {
+ var box = 'widget_box_id';
+ var queryString = {
+ gDossier: this.dossier_id,
+ 'op': 'widget',
+ 'action': 'widget.manage'
+ }
+ var action = new Ajax.Request(
+ "ajax_misc.php",
+ {
+ method: 'GET',
+ parameters: queryString,
+ onFailure: ajax_misc_failure,
+ onSuccess: function (req) {
+ if (req.responseText == 'NOCONX') {
+ reconnect();
+ return;
+ }
+ var style = 'position:absolute;';
+ var y = calcy(200);
+ style = style + ' ;top : ' + y + 'px';
+
+ add_div({id: box, cssclass: 'inner_box', html: loading(), style: style})
+
+ $(box).update(req.responseText);
+
+ }
+ }
+ );
+ } catch (e) {
+ alert_box(e.message);
+ console.error("widget_manage" + e.message);
+ }
+ return false;
+}
+/**
+ * create a list of sortable elements
+ */
+Widget.prototype.create_sortable=function() {
+
+ Sortable.create('contain_widget',{tag:'li',onUpdate:function(){ $('order_widget_hidden').value=Sortable.serialize('contain_widget')}})
+ $('order_widget_hidden').value=Sortable.serialize('contain_widget');
+}
+/**
+ * Save the order of widget
+ **/
+Widget.prototype.save = function () {
+ try
+ {
+ var here = this;
+ var dgbox="widget_box_id";
+ waiting_box();
+
+ // For form , most of the parameters are in the FORM
+ // method is then POST
+ //var queryString=$(p_form_id).serialize(true);
+
+ var queryString = {
+ op : 'widget',
+ action : 'widget.save',
+ gDossier: this.dossier_id,
+ param : Sortable.serialize('contain_widget')
+ };
+ var action = new Ajax.Request(
+ "ajax_misc.php" ,
+ {
+ method:'GET',
+ parameters:queryString,
+ onFailure:ajax_misc_failure,
+ onSuccess:function(req){
+ remove_waiting_box();
+ if (req.responseText == 'NOCONX') {
+ reconnect();
+ return;
+ }
+ removeDiv(dgbox)
+ here.refresh();
+
+ }
+ }
+ );
+ }catch( e)
+ {
+ alert_box(e.message);
+ }
+}
+/**
+ * refresh the DASHBOARD (dashboard_div_id)
+ */
+Widget.prototype.refresh = function () {
+ try {
+ var dgbox='dashboard_div_id'
+ var queryString = {
+ op : 'widget',
+ action : 'widget.refresh',
+ gDossier: this.dossier_id
+ };
+ var action = new Ajax.Request(
+ "ajax_misc.php" ,
+ {
+ method:'GET',
+ parameters:queryString,
+ onFailure:ajax_misc_failure,
+ onSuccess:function(req){
+ if (req.responseText == 'NOCONX') {
+ reconnect();
+ return;
+ }
+
+ $(dgbox).replace(req.responseText);
+
+ }
+ }
+ );
+ }catch( e) {
+ console.error("widget.refresh "+e.message)
+ }
+}
+/**
+ * delete a widget : remove from the list
+ * @param user_widget_id {integer}
+ */
+Widget.prototype.delete=function (user_widget_id) {
+ $('elt_'+user_widget_id).remove()
+ $('order_widget_hidden').value=Sortable.serialize('contain_widget');
+}
+/**
+ * display list widget we can add
+ */
+Widget.prototype.input = function () {
+ try {
+ var box="widget_box_select_id";
+
+ var queryString = {
+ op: 'widget',
+ action: 'widget.input',
+ gDossier: this.dossier_id
+ };
+ var action = new Ajax.Request(
+ "ajax_misc.php",
+ {
+ method: 'GET',
+ parameters: queryString,
+ onFailure: ajax_misc_failure,
+ onSuccess: function (req) {
+ remove_waiting_box();
+ if (req.responseText == 'NOCONX') {
+ reconnect();
+ return;
+ }
+ var style = 'position:absolute;';
+ var y = calcy(200);
+ style = style + ' ;top : ' + y + 'px';
+
+ add_div({id: box, cssclass: 'inner_box', html: loading(), style: style})
+
+ $(box).update(req.responseText);
+
+
+ }
+ }
+ );
+ } catch (e) {
+ alert_box(e.message);
+ }
+}
+/**
+ * add a widget for the user , refresh the dashboard afterward
+ * @param widget_code {string}
+ */
+Widget.prototype.add=function (widget_code) {
+ try
+ {
+ here=this;
+ var param = {};
+ if ($(widget_code+"_param")) {
+ console.debug(`found a FORM`)
+ param=$(widget_code+"_param").serialize()
+ }
+ query = {
+ op : 'widget',
+ action : 'widget.insert',
+ gDossier: this.dossier_id,
+ param : param,
+ widget_code:widget_code
+ }
+ var action = new Ajax.Request(
+ "ajax_misc.php" ,
+ {
+ method:'GET',
+ parameters:query,
+ onFailure:ajax_misc_failure,
+ onSuccess:function(req){
+ if (req.responseText == 'NOCONX') {
+ reconnect();
+ return;
+ }
+ var new_element=new Element("li");
+ $('contain_widget').appendChild(new_element);
+ new_element.replace(req.responseText)
+ removeDiv('widget_box_select_id')
+ here.create_sortable()
+ here.refresh()
+
+ }
+ }
+ );
+ }catch( e)
+ {
+ alert_box(e.message);
+ }
+
+}
\ No newline at end of file
diff --git a/html/js/todo_list.js b/html/js/todo_list.js
index c22eb30ea..426da8736 100644
--- a/html/js/todo_list.js
+++ b/html/js/todo_list.js
@@ -185,11 +185,11 @@ function zoom_todo ()
waiting_box();
if ( ! todo_maximize)
{
- var clonetodo=$('todo_listg_div').clone();
+ var clonetodo=$('todo_list').clone();
clonetodo.setAttribute('id','clone_todo_list')
clonetodo.setStyle({'z-index':1,'position':'absolute','width':'95%','height':'95%','top':'2%','right':'2%','left':'2%'})
- clonetodo.innerHTML=$('todo_listg_div').innerHTML;
- $('todo_listg_div').innerHTML="";
+ clonetodo.innerHTML=$('todo_list').innerHTML;
+ $('todo_list').innerHTML="";
clonetodo.addClassName('inner_box');
clonetodo.removeClassName('box');
document.body.appendChild(clonetodo);
@@ -197,7 +197,7 @@ function zoom_todo ()
} else
{
todo_maximize=false;
- $('todo_listg_div').innerHTML=$('clone_todo_list').innerHTML;
+ $('todo_list').innerHTML=$('clone_todo_list').innerHTML;
$('clone_todo_list').remove();
}
diff --git a/include/ajax/ajax_preference.php b/include/ajax/ajax_preference.php
index f66c6cb99..719bf21f4 100644
--- a/include/ajax/ajax_preference.php
+++ b/include/ajax/ajax_preference.php
@@ -257,23 +257,6 @@ if ( $action == 'display_form' )
';
- echo '';
- echo _('Mini-Rapport : ');
- $rapport = new Acc_Report($cn);
- $aRapport = $rapport->make_array();
- $aRapport[] = array("value" => 0, "label" => _('Aucun mini rapport'));
- $wRapport = new ISelect();
- $wRapport->name = "minirap";
- $wRapport->selected = $g_user->get_mini_report();
- $wRapport->value = $aRapport;
- echo $wRapport->input();
- echo '' . _('Le mini rapport est un rapport qui s\'affiche sur votre page d\'accueil') . '';
- echo '';
- }
echo '