[openads-Commits] r7976 - in branches/4.7.0_evo_redaction_libre: app/css app/js obj sql/pgsql

0 views
Skip to first unread message

sof...@adullact.net

unread,
Jul 13, 2018, 1:02:11 PM7/13/18
to openmairi...@googlegroups.com
Author: softime
Date: 2018-07-13 19:02:07 +0200 (Fri, 13 Jul 2018)
New Revision: 7976

Modified:
branches/4.7.0_evo_redaction_libre/app/css/app.css
branches/4.7.0_evo_redaction_libre/app/js/script.js
branches/4.7.0_evo_redaction_libre/obj/instruction.class.php
branches/4.7.0_evo_redaction_libre/obj/om_formulaire.class.php
branches/4.7.0_evo_redaction_libre/sql/pgsql/instruction.form.inc.php
Log:
* Ajout des boutons ?\195?\160 bascule pour la r?\195?\169daction d'une instruction
(en cours de dev)

Modified: branches/4.7.0_evo_redaction_libre/app/css/app.css
===================================================================
--- branches/4.7.0_evo_redaction_libre/app/css/app.css 2018-07-13 16:15:09 UTC (rev 7975)
+++ branches/4.7.0_evo_redaction_libre/app/css/app.css 2018-07-13 17:02:07 UTC (rev 7976)
@@ -1872,11 +1872,67 @@
.redac-complement-16 { background-image: url("../img/redac-complement-16x16.png"); }
.redac-libre-16 { background-image: url("../img/redac-libre-16x16.png"); }

-.btn-refresh-preview {
+.httpclickbutton {
padding: .4em 1em;
+ margin-bottom: 5px;
}
-.btn-refresh-preview:hover { border: 1px solid #999999; background: #dadada url(../../om-theme/jquery-ui-theme/images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #212121; }
+.httpclickbutton:hover {
+ border: 1px solid #999999;
+ background: #dadada url(../../om-theme/jquery-ui-theme/images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
+ font-weight: bold;
+ color: #212121;
+}

+/**
+ * Supprime les marges
+ */
.col_1, .col_2, .col_3, .col_4, .col_5, .col_6,
.col_7, .col_8, .col_9, .col_10, .col_11, .col_12
{display: block; float: left; margin: 0;}
+
+.container_instr_edition {
+ display: flex;
+ flex-wrap: nowrap;
+}
+
+.container_instr_edition .box_instr_edition {
+ width: 50%;
+}
+
+@media screen and (max-width: 1280px) {
+ .container_instr_edition .box_instr_edition {
+ width: 100%;
+ display: flex;
+ }
+ .container_instr_edition .box_instr_edition .without_btn {
+ width: 80%;
+ }
+ .box_btn_preview {
+ width: 20%;
+ padding-top: 10px;
+ padding-left: auto;
+ padding-right: auto;
+ /*margin: auto;*/
+ /*padding: auto;*/
+ }
+ .container_instr_edition .box_instr_edition .box_live_preview {
+ width: 80%;
+ }
+ .box_btn_redaction {
+ width: 20%;
+ padding-top: 10px;
+ padding-left: auto;
+ padding-right: auto;
+ /*margin: auto;*/
+ /*padding: auto;*/
+ }
+}
+
+.container_instr_edition .box_instr_edition fieldset.titre_instr_edition {
+ border: 0px;
+ padding: 0px;
+}
+
+.container_instr_edition .box_instr_edition fieldset.titre_instr_edition legend {
+ border: 0px;
+}

Modified: branches/4.7.0_evo_redaction_libre/app/js/script.js
===================================================================
--- branches/4.7.0_evo_redaction_libre/app/js/script.js 2018-07-13 16:15:09 UTC (rev 7975)
+++ branches/4.7.0_evo_redaction_libre/app/js/script.js 2018-07-13 17:02:07 UTC (rev 7976)
@@ -2452,15 +2452,6 @@
});
}

- // Si l'iframe de prévisualisation du PDF existe dans la page
- if ($("#fieldset-sousform-instruction-previsualisation .field-type-pdf #frame_content").size() != 0
- || $("#fieldset-sousform-instruction_contexte_ctx_inf-previsualisation .field-type-pdf #frame_content").size() != 0
- || $("#fieldset-sousform-instruction_contexte_ctx_re-previsualisation .field-type-pdf #frame_content").size() != 0) {
- // Redimensionne la taille du contenu après 5 secondes afin de laisser
- // le temps à tinymce de calculer la taille des champs compléments
- setTimeout(resize_frame_pdf, 2000);
- }
-
// Change la liste à choix de l'événement sur l'instruction avec chosen
// Le div.formEntete doit avoir sa propriété overflow à visible pour que le
// contenu de la liste à choix soit correctement affiché
@@ -2474,23 +2465,107 @@
});

// Si le bouton de refresh de la preview existe sur la page
- if ($('.btn-refresh-preview').exists()) {
+ if ($('#btn_refresh').exists() && $('#btn_refresh').is(":visible")) {
// Position initiale du bouton pour rafraîchir la preview
- btn_refresh_top = $('.btn-refresh-preview').offset().top
+ btn_refresh_top = $('#btn_refresh').parent().offset().top-50
// Le bonton de refresh de la preview suit le scroll de la page
$(window).scroll(function (event) {
if ($(window).scrollTop() > btn_refresh_top){
- $(".btn-refresh-preview").css("position","fixed");
- $(".btn-refresh-preview").css("top", 20);
+ $("#btn_refresh").css("position","fixed");
+ $("#btn_refresh").css("top", 20);
+ $("#btn_refresh").css("z-index", 9999);
} else {
- $(".btn-refresh-preview").css("position","relative");
- $(".btn-refresh-preview").css("top", 0);
+ $("#btn_refresh").css("position","relative");
+ $("#btn_refresh").css("top", 0);
}
});
}
+
+ // Si le bouton de refresh de la preview existe sur la page
+ if ($('#btn_preview').exists()) {
+ // Position initiale du bouton pour rafraîchir la preview
+ btn_preview_top = $('#btn_preview').parent().offset().top-50
+ // Le bonton de refresh de la preview suit le scroll de la page
+ $(window).scroll(function (event) {
+ if ($(window).scrollTop() > btn_preview_top){
+ $("#btn_preview").css("position","fixed");
+ $("#btn_preview").css("top", 20);
+ $("#btn_preview").css("height", 50);
+ $("#btn_preview").css("padding", "auto");
+ $("#btn_preview").css("z-index", 9999);
+ } else {
+ $("#btn_preview").css("position","relative");
+ $("#btn_preview").css("top", 0);
+ }
+ });
+ }
+
+ // Si le bouton de refresh de la preview existe sur la page
+ if ($('#btn_redaction').exists()) {
+ // Position initiale du bouton pour rafraîchir la preview
+ btn_redaction_top = $('#btn_redaction').parent().offset().top-50
+ // Le bonton de refresh de la preview suit le scroll de la page
+ $(window).scroll(function (event) {
+ if ($(window).scrollTop() > btn_redaction_top){
+ $("#btn_redaction").css("position","fixed");
+ $("#btn_redaction").css("top", 20);
+ $("#btn_redaction").css("z-index", 9999);
+ } else {
+ $("#btn_redaction").css("position","relative");
+ $("#btn_redaction").css("top", 0);
+ }
+ });
+ }
+
+ // Depuis une instruction en modification, si la prévisualisation du PDF est
+ // activée et que l'écran de l'utilisateur est de petite taille
+ if ($(".container_instr_edition").exists() === true
+ && screen.width <= 1280) {
+ //
+ $(".preview_instr_edition").hide();
+ // $(".redaction_instr_edition").width('auto');
+ //
+ $("#btn_redaction").parent().parent().hide();
+ $("#btn_refresh").parent().parent().hide();
+ }
+ // Sur les plus grands écrans
+ if ($(".container_instr_edition").exists() === true
+ && screen.width > 1280) {
+ //
+ $("#btn_preview").parent().parent().hide();
+ $("#btn_redaction").parent().parent().hide();
+ }
+
+ // Si l'iframe de prévisualisation du PDF existe dans la page
+ if ($(".preview_instr_edition .field-type-pdf #frame_content").exists() === true
+ && $(".preview_instr_edition .field-type-pdf #frame_content").is (":visible")) {
+ // Redimensionne la taille du contenu après 5 secondes afin de laisser
+ // le temps à tinymce de calculer la taille des champs compléments
+ setTimeout(resize_frame_pdf, 1000);
+ }
}

+function show_instr_preview() {
+ $(".redaction_instr_edition").hide();
+ $(".preview_instr_edition").show();
+ //
+ $("#btn_preview").parent().parent().hide();
+ $("#btn_redaction").parent().parent().show();
+ //
+ reload_pdf_viewer();
+}

+function show_instr_redaction() {
+ $(".redaction_instr_edition").show();
+ $(".preview_instr_edition").hide();
+ //
+ $("#btn_preview").parent().parent().show();
+ $("#btn_redaction").parent().parent().hide();
+ //
+ $(window).scrollTop($(".container_instr_edition").offset().top);
+}
+
+
function activate_data_href() {
$('#sousform-href-disabled').attr('id', 'sousform-href');
}
@@ -3803,7 +3878,7 @@
url: link,
data: params,
dataType: "json",
- async: true,
+ async: false,
success: function(data){
$("#frame_content").html(
'<iframe src="data:application/pdf;base64,'+data.base+'" id="frame_pdf"></iframe>'
@@ -3810,6 +3885,8 @@
);
// Redimensionne la taille de l'iframe contenant le PDF
resize_frame_pdf();
+ //
+ $(window).scrollTop($(".container_instr_edition").offset().top);
}
});
}
@@ -3822,12 +3899,19 @@
* @return void
*/
function resize_frame_pdf() {
- // Récupère la taille du container comprenant les compléments et
- // l'iframe de prévisualisation du PDF
- var height = $('.container_preview_pdf').height();
- // Redimensionne l'iframe en supprimant les élements au dessus
- // et en dessous de l'iframe
- $("#frame_pdf").height(height-80);
+
+ //
+ // if (screen.width <= 1280) {
+ $("#frame_pdf").height($('.box_instr_edition').height()-15);
+ $("#frame_pdf").width($('.box_live_preview').width()-15);
+ // } else {
+ // // Récupère la taille du container comprenant les compléments et
+ // // l'iframe de prévisualisation du PDF
+ // var height = $('.container_instr_edition').height();
+ // // Redimensionne l'iframe en supprimant les élements au dessus
+ // // et en dessous de l'iframe
+ // $("#frame_pdf").height(height-95);
+ // }
}



Modified: branches/4.7.0_evo_redaction_libre/obj/instruction.class.php
===================================================================
--- branches/4.7.0_evo_redaction_libre/obj/instruction.class.php 2018-07-13 16:15:09 UTC (rev 7975)
+++ branches/4.7.0_evo_redaction_libre/obj/instruction.class.php 2018-07-13 17:02:07 UTC (rev 7976)
@@ -553,6 +553,8 @@
if ($this->f->is_option_preview_pdf_enabled($collectivite_di) === true) {
//
$form->setType('btn_refresh', 'httpclickbutton');
+ $form->setType('btn_preview', 'httpclickbutton');
+ $form->setType('btn_redaction', 'httpclickbutton');
$form->setType('live_preview', 'pdf');
}

@@ -564,13 +566,14 @@
if (($this->f->isAccredited(array($this->get_absolute_class_name(), $this->get_absolute_class_name()."modification_dates"), "OR")
|| $this->f->isAccredited(array('instruction', 'instruction_modification_dates'), "OR"))
&& $this->getVal("date_finalisation_courrier") != '') {
- $form->setType('date_envoi_signature', 'date');
- $form->setType('date_retour_signature', 'date');
- $form->setType('date_envoi_rar', 'date');
- $form->setType('date_retour_rar', 'date');
- $form->setType('date_envoi_controle_legalite', 'date');
- $form->setType('date_retour_controle_legalite', 'date');
- $form->setType('date_finalisation_courrier', 'date');
+ //
+ // $form->setType('date_envoi_signature', 'date');
+ // $form->setType('date_retour_signature', 'date');
+ // $form->setType('date_envoi_rar', 'date');
+ // $form->setType('date_retour_rar', 'date');
+ // $form->setType('date_envoi_controle_legalite', 'date');
+ // $form->setType('date_retour_controle_legalite', 'date');
+ // $form->setType('date_finalisation_courrier', 'date');
// suivi des dates
if ($maj == 125) {
$form->setType('date_evenement', 'hiddenstaticdate');
@@ -815,6 +818,8 @@
$base64 = $this->init_pdf_temp();
$form->setSelect('live_preview', array('base64'=>$base64));
$form->setSelect("btn_refresh", array(_('Actualiser')));
+ $form->setSelect("btn_preview", array(_('Prévisualisation')));
+ $form->setSelect("btn_redaction", array(_('Rédaction')));
}

// Selection du type de rédaction à l'ajout
@@ -1025,6 +1030,8 @@
&& $this->has_an_edition() === true) {
$form->setVal("live_preview",$this->getVal($this->clePrimaire));
$form->setVal("btn_refresh","reload_pdf_viewer()");
+ $form->setVal("btn_preview","show_instr_preview()");
+ $form->setVal("btn_redaction","show_instr_redaction()");
}
}

@@ -1056,8 +1063,16 @@
//
if ($this->f->is_option_preview_pdf_enabled($collectivite_di) === true
&& $this->has_an_edition() === true) {
- $form->setBloc('complement_om_html','D',"","col_12 container_preview_pdf");
- $form->setBloc('complement_om_html','D',"","col_6 hidelabel");
+ //
+ $form->setBloc('complement_om_html','D',"","container_instr_edition");
+ $form->setBloc('complement_om_html','D',"","hidelabel box_instr_edition redaction_instr_edition");
+ $form->setBloc('complement_om_html','D',"","without_btn");
+ // $form->setBloc('complement_om_html','DF', _("complement_om_html"),"");
+ // $form->setBloc('complement2_om_html','DF', _("complement2_om_html"),"");
+ // $form->setBloc('complement3_om_html','DF', _("complement3_om_html"),"");
+ // $form->setBloc('complement4_om_html','DF', _("complement4_om_html"),"");
+ // $form->setFieldset('titre_om_htmletat','DF',_('Titre'), 'startClosed titre_instr_edition');
+ // $form->setBloc('corps_om_htmletatex','DF', _("corps_om_htmletatex"),"");
$form->setFieldset('complement_om_html','D',_('Complement'));
$form->setFieldset('bible','F','');
$form->setFieldset('complement2_om_html','D',_('Complement 2'));
@@ -1069,13 +1084,16 @@
$form->setFieldset('titre_om_htmletat','DF',_('Titre'), 'startClosed');
$form->setFieldset('corps_om_htmletatex','DF',_('Corps'));
$form->setBloc('corps_om_htmletatex','F');
- $form->setBloc('btn_refresh','D',"","col_6 hidelabel");
- $form->setFieldset('btn_refresh','D',_('Prévisualisation'));
+ $form->setBloc('btn_preview','DF',"","box_btn_preview");
+ $form->setBloc('btn_preview','F');
+ $form->setBloc('btn_redaction','D', '',"hidelabel box_instr_edition preview_instr_edition");
+ $form->setBloc('btn_redaction','DF',"","box_btn_redaction");
+ $form->setFieldset('btn_refresh','D',_('Prévisualisation'), "box_live_preview");
$form->setFieldset('live_preview','F');
$form->setBloc('live_preview','F');
$form->setBloc('live_preview','F');
} else {
- $form->setBloc('complement_om_html','D',"","col_12 hidelabel");
+ $form->setBloc('complement_om_html','D',"","hidelabel");
$form->setFieldset('complement_om_html','D',_('Complement'));
$form->setFieldset('bible','F','');
$form->setFieldset('complement2_om_html','D',_('Complement 2'));
@@ -1089,7 +1107,7 @@
$form->setBloc('corps_om_htmletatex','F');
}
} else {
- $form->setBloc('complement_om_html','D',"","col_12 hidelabel");
+ $form->setBloc('complement_om_html','D',"","hidelabel");
$form->setFieldset('complement_om_html','D',_('Complement'));
$form->setFieldset('bible','F','');
$form->setFieldset('complement2_om_html','D',_('Complement 2'));
@@ -1114,6 +1132,8 @@
$form->setLib('bible3', "");
$form->setLib('bible4', "");
$form->setLib('btn_refresh', "");
+ $form->setLib('btn_preview', "");
+ $form->setLib('btn_redaction', "");
$form->setLib('live_preview', "");
$form->setLib('om_final_instruction_utilisateur', _("finalise par"));
$form->setLib('flag_edition_integrale', _("Type de rédaction"));

Modified: branches/4.7.0_evo_redaction_libre/obj/om_formulaire.class.php
===================================================================
--- branches/4.7.0_evo_redaction_libre/obj/om_formulaire.class.php 2018-07-13 16:15:09 UTC (rev 7975)
+++ branches/4.7.0_evo_redaction_libre/obj/om_formulaire.class.php 2018-07-13 17:02:07 UTC (rev 7976)
@@ -402,7 +402,7 @@
// 'onclick' => $this->val[$champ],
// );
// $this->f->layout->display_form_button($params);
- echo "<a class='btn-refresh-preview om-button ui-button ui-widget ui-state-default ui-corner-all' href='#' onclick=\"".$this->val[$champ]."; return false;\" >";
+ echo "<a id='".$champ."' class='httpclickbutton om-button ui-button ui-widget ui-state-default ui-corner-all' href='#' onclick=\"".$this->val[$champ]."; return false;\" >";
echo $aff;
echo "</a>\n";


Modified: branches/4.7.0_evo_redaction_libre/sql/pgsql/instruction.form.inc.php
===================================================================
--- branches/4.7.0_evo_redaction_libre/sql/pgsql/instruction.form.inc.php 2018-07-13 16:15:09 UTC (rev 7975)
+++ branches/4.7.0_evo_redaction_libre/sql/pgsql/instruction.form.inc.php 2018-07-13 17:02:07 UTC (rev 7976)
@@ -33,24 +33,13 @@

"titre_om_htmletat",
"corps_om_htmletatex",
-
+
+ "'' as btn_preview",
+ "'' as btn_redaction",
+
"'' as btn_refresh",
"'' as live_preview",

- "complement5_om_html",
- "'' as bible5",
- "complement6_om_html",
- "'' as bible6",
- "complement7_om_html",
- "'' as bible7",
- "complement8_om_html",
- "'' as bible8",
- "complement9_om_html",
- "'' as bible9",
- "complement10_om_html",
- "'' as bible10",
- "complement11_om_html",
- "'' as bible11",
"dossier",
"instruction.action",
"instruction.delai",
@@ -74,6 +63,20 @@
"archive_date_chantier",
"archive_date_dernier_depot",
"date_depot",
+ "complement5_om_html",
+ "'' as bible5",
+ "complement6_om_html",
+ "'' as bible6",
+ "complement7_om_html",
+ "'' as bible7",
+ "complement8_om_html",
+ "'' as bible8",
+ "complement9_om_html",
+ "'' as bible9",
+ "complement10_om_html",
+ "'' as bible10",
+ "complement11_om_html",
+ "'' as bible11",
"complement12_om_html",
"complement13_om_html",
"complement14_om_html",

Reply all
Reply to author
Forward
0 new messages