[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 07/09: WIDGET : db upgrade 199
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 07/09: WIDGET : db upgrade 199 |
Date: |
Mon, 19 Aug 2024 15:03:10 -0400 (EDT) |
sparkyx pushed a commit to branch unstable
in repository noalyss.
commit 9ed7fe540e0b5e36069aeed93da0c65bdc7d075e
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Mon Aug 19 18:52:01 2024 +0200
WIDGET : db upgrade 199
---
include/constant.php | 2 +-
.../sql/patch/upgrade199.sql | 22 ++-----
include/widget/ajax.php | 2 +-
sql/upgrade.sql | 75 ----------------------
4 files changed, 9 insertions(+), 92 deletions(-)
diff --git a/include/constant.php b/include/constant.php
index 6ceb328f1..a984eeefe 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -28,7 +28,7 @@ global $version_noalyss;
define('NOALYSS_VERSION', 9206 );
// Database schema version
-define("DBVERSION", 199);
+define("DBVERSION", 200);
// version for MONO_DATABASE
define("MONO_DATABASE", 25);
diff --git a/sql/upgrade.sql b/include/sql/patch/upgrade199.sql
similarity index 64%
copy from sql/upgrade.sql
copy to include/sql/patch/upgrade199.sql
index c8746858c..88e874836 100644
--- a/sql/upgrade.sql
+++ b/include/sql/patch/upgrade199.sql
@@ -1,3 +1,5 @@
+begin;
+
alter table attr_min add ad_default_order int;
update attr_min set ad_default_order = a1.ad_default_order from attr_def a1
where a1.ad_id = attr_min.ad_id;
@@ -31,8 +33,9 @@ drop table if exists widget_dashboard;
create table widget_dashboard(
wd_id int primary key generated by default as
identity,
wd_code text not null,
+ wd_name text not null,
wd_description text not null,
- wp_parameter int not null default 0
+ wd_parameter int not null default 0
);
@@ -45,23 +48,9 @@ create table user_widget(
uw_order int
);
-ALTER TABLE public.widget_dashboard RENAME COLUMN wp_parameter TO wd_parameter;
ALTER TABLE public.widget_dashboard ADD CONSTRAINT widget_dashboard_unique
UNIQUE (wd_code);
-INSERT INTO public.widget_dashboard
(wd_id,wd_code,wd_description,wd_parameter,wd_name) VALUES
-
(1,'agenda','Présentation d''un calendrier avec les dates de rappel des
événements',0,'Agenda'),
-
(2,'todo_list','Liste de choses à faire , de petites
notes',0,'Pense-Bête'),
-
(3,'coming_event','Rappel pour des actions pour aujourd''hui ou en
retard',0,'Actions'),
-
(4,'last_operation','Affichage des dernières opérations comptables
saisies',0,'Comptabilité'),
-
(5,'last_event','Affiche les derniers actions de suivi',0,'Suivi'),
-
(6,'mini_report','Affiche des rapports de comptabilité',1,'Rapport');
-
-
-alter table public.widget_dashboard add wd_name text;
-ALTER TABLE public.widget_dashboard ALTER COLUMN wd_name SET NOT NULL;
-
-ALTER TABLE public.widget_dashboard ALTER COLUMN wd_name SET NOT NULL;
COMMENT ON COLUMN public.widget_dashboard.wd_name IS 'Name';
COMMENT ON COLUMN public.widget_dashboard.wd_id IS 'PK';
COMMENT ON COLUMN public.widget_dashboard.wd_code IS 'Code';
@@ -73,3 +62,6 @@ update menu_ref set me_menu = 'Impression 📊' where
me_code='PRINT';
update menu_ref set me_menu = me_menu || '📊' where me_code='RAPAV';
update menu_ref set me_menu = me_menu ||' 📇' where me_code='CARD';
update menu_ref set me_menu = 'Favori ✨' where me_code='BOOKMARK';
+
+insert into version (val,v_description) values (200,'Widget and improve menu');
+commit;
\ No newline at end of file
diff --git a/include/widget/ajax.php b/include/widget/ajax.php
index 883778a51..66ab5d894 100644
--- a/include/widget/ajax.php
+++ b/include/widget/ajax.php
@@ -70,7 +70,7 @@ if ( $w != "widget") {
// action == manage , display a dialog box to add , remove or change parameter
of widget
// if must possible to add several time the same widget , example mini-report
if ( $action == 'widget.manage') {
- echo \HtmlInput::title_box(_("Elements"), 'widget_box_id');
+ echo \HtmlInput::title_box(_("Elements"), 'widget_box_id',p_mod: 'none');
echo '<div style="padding:0.3rem">';
echo span(_('Organiser les éléments en utilisant la souris (Drag & Drop)
puis sauver'),'class="text-muted text-center"');
\Noalyss\Widget\Widget::display_available();
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index c8746858c..e69de29bb 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -1,75 +0,0 @@
-alter table attr_min add ad_default_order int;
-
-update attr_min set ad_default_order = a1.ad_default_order from attr_def a1
where a1.ad_id = attr_min.ad_id;
-
-
-select replace_menu_code('CFGACC','C0PST');
-select replace_menu_code('CFGDOC','C0DOC');
-select replace_menu_code('CFGSEC','C0SEC');
-select replace_menu_code('CFGPCMN','C0PCMN');
-select replace_menu_code('CFGPRO','C0PROFL');
-select replace_menu_code('CFGLED','C0JRN');
-select replace_menu_code('CFGDOCST','C1DOC');
-select replace_menu_code('CFGDEFMENU','C0MENU');
-select replace_menu_code('CFGPAY','C0PAY');
-select replace_menu_code('CFGCURRENCY','C0DEV');
-select replace_menu_code('CFGACTION','C0ACT');
-select replace_menu_code('CFGOPT1','C0OPT1');
-select replace_menu_code('CFGSTOCK','C0STOCK');
-select replace_menu_code('CFGPLUGIN','C0PLG');
-select replace_menu_code('CFGTAG','C0TAG');
-
-update menu_ref set me_description ='Configuration des extensions' where
me_code='C0PLG';
-update menu_ref set me_description ='Clef de répartition pour la comptabilité
analytique' where me_code='ANCKEY';
-
---- widget pour DASHBOARD
-drop table dashboard_widget;
-drop table if exists user_widget;
-drop table if exists user_widger;
-drop table if exists widget_dashboard;
-
-create table widget_dashboard(
- wd_id int primary key generated by default as
identity,
- wd_code text not null,
- wd_description text not null,
- wp_parameter int not null default 0
-);
-
-
-
-create table user_widget(
- uw_id int primary key generated by default as
identity,
- use_login text not null,
- dashboard_widget_id int not null references
widget_dashboard(wd_id) on update cascade on delete cascade,
- uw_parameter text ,
- uw_order int
-);
-
-ALTER TABLE public.widget_dashboard RENAME COLUMN wp_parameter TO wd_parameter;
-ALTER TABLE public.widget_dashboard ADD CONSTRAINT widget_dashboard_unique
UNIQUE (wd_code);
-
-INSERT INTO public.widget_dashboard
(wd_id,wd_code,wd_description,wd_parameter,wd_name) VALUES
-
(1,'agenda','Présentation d''un calendrier avec les dates de rappel des
événements',0,'Agenda'),
-
(2,'todo_list','Liste de choses à faire , de petites
notes',0,'Pense-Bête'),
-
(3,'coming_event','Rappel pour des actions pour aujourd''hui ou en
retard',0,'Actions'),
-
(4,'last_operation','Affichage des dernières opérations comptables
saisies',0,'Comptabilité'),
-
(5,'last_event','Affiche les derniers actions de suivi',0,'Suivi'),
-
(6,'mini_report','Affiche des rapports de comptabilité',1,'Rapport');
-
-
-
-alter table public.widget_dashboard add wd_name text;
-ALTER TABLE public.widget_dashboard ALTER COLUMN wd_name SET NOT NULL;
-
-ALTER TABLE public.widget_dashboard ALTER COLUMN wd_name SET NOT NULL;
-COMMENT ON COLUMN public.widget_dashboard.wd_name IS 'Name';
-COMMENT ON COLUMN public.widget_dashboard.wd_id IS 'PK';
-COMMENT ON COLUMN public.widget_dashboard.wd_code IS 'Code';
-COMMENT ON COLUMN public.widget_dashboard.wd_description IS 'Description';
-COMMENT ON COLUMN public.widget_dashboard.wd_parameter IS 'presence of there
is a parameter';
-
-update menu_ref set me_menu = me_menu ||' 👤' where
me_code='PREFERENCE';
-update menu_ref set me_menu = 'Impression 📊' where me_code='PRINT';
-update menu_ref set me_menu = me_menu || '📊' where me_code='RAPAV';
-update menu_ref set me_menu = me_menu ||' 📇' where me_code='CARD';
-update menu_ref set me_menu = 'Favori ✨' where me_code='BOOKMARK';
- [Noalyss-commit] [noalyss] branch unstable updated (bed2fd54a -> ffa6cb848), dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 04/09: Documentation, dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 02/09: Widget : add install.php for each, dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 03/09: Widget : javascript variable uniq, dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 08/09: PHPUnit : update test, dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 09/09: Cosmetic : loading of widget, dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 06/09: WIDGET : ergonomy, show a number on the widget the dialog box to manage them appears, dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 01/09: widget : Creation of widget for the DASHBOARD Contains widget Agenda, Todo List, Report , ..., dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 05/09: Cosmetic and Documentation, dwm, 2024/08/19
- [Noalyss-commit] [noalyss] 07/09: WIDGET : db upgrade 199,
dwm <=