diff --git a/lib/init.js b/lib/init.js
index 2ec1e2a25..2e2156eed 100644
--- a/lib/init.js
+++ b/lib/init.js
@@ -54,11 +54,26 @@ $(document).ready(function () {
collapse: false,
sideBySide: true,
useCurrent: false,
- stepping: 5,
+ stepping: 5,
+ widgetPositioning: {
+ horizontal: 'left',
+ vertical: 'bottom'
+ },
minDate: moment($this.attr('min-date')).isValid() ? $this.attr('min-date') : false,
maxDate: moment($this.attr('max-date')).isValid() ? $this.attr('max-date') : false,
});
});
+
+ //fix per timestamp-picker non visibile con la classe table-responsive
+ $('.timestamp-picker').each(function () {
+ $this = $(this)
+ $this.on("dp.show", function (e) {
+ $('#tecnici > div').removeClass('table-responsive');
+ })
+ $this.on("dp.hide", function (e) {
+ $('#tecnici > div').addClass('table-responsive');
+ })
+ });
$('.datepicker').each(function () {
$this = $(this);
diff --git a/modules/contratti/plugins/addpianficazione.php b/modules/contratti/plugins/addpianficazione.php
index d86153045..b880bafcd 100644
--- a/modules/contratti/plugins/addpianficazione.php
+++ b/modules/contratti/plugins/addpianficazione.php
@@ -144,7 +144,7 @@ echo '
echo '
- {( "name": "filelist_and_upload", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "id_plugin": "'.$id_plugin.'" )}
+ {( "name": "filelist_and_upload", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "id_plugin": "'.$id_plugin.'", "ajax":"true", '.((!empty($readonly)) ? '"readonly":"true"' : '"readonly":"false"' ). ' )}
diff --git a/modules/contratti/plugins/contratti.pianificazioneinterventi.php b/modules/contratti/plugins/contratti.pianificazioneinterventi.php
index 50cf681f9..6ce341ffc 100644
--- a/modules/contratti/plugins/contratti.pianificazioneinterventi.php
+++ b/modules/contratti/plugins/contratti.pianificazioneinterventi.php
@@ -262,6 +262,7 @@ if (count($rsp) != 0) {
'.tr('Sede').'
'.tr('Impianti').'
'.tr('Materiali').'
+ '.tr('Allegati').'
'.tr('Opzioni').'
@@ -341,6 +342,7 @@ if (count($rsp) != 0) {
'.$info_sede.'
'.$info_impianti.'
'.$info_materiali.'
+ '.$info_allegati.'
';
echo '
diff --git a/src/HTMLBuilder/Manager/FileManager.php b/src/HTMLBuilder/Manager/FileManager.php
index dbb22a276..c171bbbb2 100644
--- a/src/HTMLBuilder/Manager/FileManager.php
+++ b/src/HTMLBuilder/Manager/FileManager.php
@@ -9,6 +9,7 @@ class FileManager implements ManagerInterface
{
public function manage($options)
{
+ $options['readonly'] = ($options['readonly']=='true') ? true : false;
$options['ajax'] = isset($options['ajax']) ? $options['ajax'] : false;
$options['showpanel'] = isset($options['showpanel']) ? $options['showpanel'] : true;
$options['label'] = isset($options['label']) ? $options['label'] : tr('Nuovo allegato').':';
@@ -40,7 +41,7 @@ $result .= '
'.tr('Nome').'
'.tr('Data').'
- #
+ #
';
foreach ($rs as $r) {
@@ -53,13 +54,18 @@ $result .= '
'.\Translator::timestampToLocale($r['created_at']).'
-
+
-
-
-
+ ';
+
+ if (!$options['readonly']){
+ $result .= '
+
-
+ ';
+ }
+
+ $result .= '
';
}
@@ -68,26 +74,43 @@ $result .= '
';
- }
+ }else{
+ //in caso di readonly, se non è stato caricato nessun allegato mostro almeno box informativo
+ if ($options['readonly']){
+ $result .= '
+
+
+ '.tr('Nessun allegato è stato caricato', []).'.
+
';
+ }
+ }
+
+ if (!$options['readonly']){
+
// Form per l'upload di un nuovo file
$result .= '
'.$options['label'].'
+
{[ "type": "text", "placeholder": "'.tr('Nome').'", "name": "nome_allegato", "id": "nome_allegato_'.$options['id_record'].((!empty($options['id_plugin'])) ? '_'.$options['id_plugin'] : '').'" ]}
{[ "type": "file", "placeholder": "'.tr('File').'", "name": "blob", "id": "blob_'.$options['id_record'].((!empty($options['id_plugin'])) ? '_'.$options['id_plugin'] : '').'", "required": 0 ]}
-
-
-
-
- '.tr('Carica').'
-
-
+
';
+
+ $result .= '
+
+
+ '.tr('Carica').'
+
+
';
+
+ $result .= '
';
+ }
$result .= '