]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix configure Bacula hosts page to work with PHP 7.4
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 27 Jun 2020 20:11:27 +0000 (22:11 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 27 Jun 2020 20:11:27 +0000 (22:11 +0200)
gui/baculum/protected/Web/Portlets/BaculaConfigComponents.php
gui/baculum/protected/Web/Portlets/BaculaConfigComponents.tpl
gui/baculum/protected/Web/Portlets/BaculaConfigResources.php
gui/baculum/protected/Web/Portlets/BaculaConfigResources.tpl
gui/baculum/protected/Web/Portlets/BaculaHosts.tpl
gui/baculum/protected/Web/Portlets/DirectiveMessages.php
gui/baculum/protected/Web/Portlets/DirectiveMessages.tpl
gui/baculum/protected/Web/Portlets/MessageTypes.php

index b622cfcc69b1b6af1e3b947359449f3850fa1ffd..05ba7a9a28ab2ba708f2ca5586436f99d715e733 100644 (file)
@@ -72,6 +72,10 @@ class BaculaConfigComponents extends ComponentListTemplate {
        }
 
        public function createComponentListElement($sender, $param) {
+               if (!is_array($param->Item->Data)) {
+                       // skip parent repeater items
+                       return;
+               }
                $conts = array(self::MENU_CONTROL, self::ACTIONS_CONTROL);
                for ($i = 0; $i < count($conts); $i++) {
                        $controls = array(self::CHILD_CONTROL, $conts[$i]);
index 2bf3db73849a2e8b0970b1f2d555286661346b11..18ea121f6b0a0b730acd244ab75d92ad202a3687 100644 (file)
@@ -12,7 +12,7 @@
                                                        ClientSide.OnLoading="BaculaConfig.loader_start(sender.options.ID);"
                                                        ClientSide.OnComplete="BaculaConfig.set_config_items(sender.options.ID);"
                                                        Attributes.onclick="return BaculaConfig.unset_config_items(this.id);"
-                                                       Text="<strong><%=$this->Data['label']%></strong>: <%=$this->Data['component_name']%>"
+                                                       Text="<strong><%#$this->Data['label']%></strong>: <%#$this->Data['component_name']%>"
                                                        Style="text-decoration: none"
                                                />
                                                        <i class="fa fa-sync w3-spin" style="display: none"><i/>
index b4fc2517e39511f0793f7dd0d771a48ad1bca468..91412cba10f58de2f0ba561b27aa9fb0b5b4a33c 100644 (file)
@@ -75,6 +75,10 @@ class BaculaConfigResources extends ResourceListTemplate {
        }
 
        public function createResourceListElement($sender, $param) {
+               if (!is_array($param->Item->Data)) {
+                       // skip parent repeater items
+                       return;
+               }
                $control = $this->getChildControl($param->Item, self::CHILD_CONTROL);
                if (is_object($control)) {
                        $control->setHost($param->Item->Data['host']);
index 397d1c161e9d189a95b17bb1d4d97f5ffd24ee40..f70e65145f074420fc30bb7d2e8a11a8141767ac 100644 (file)
@@ -18,8 +18,8 @@
                                        var t = event.target || event.srcElement;
                                        var nn = t.nodeName.toUpperCase();
                                        var cmsg = '<%[ Are you sure that you want to remove %s resource "%s"? ]%>';
-                                       cmsg = cmsg.replace('%s', '<%=$this->Data['resource_type']%>');
-                                       cmsg = cmsg.replace('%s', '<%=$this->Data['resource_name']%>');
+                                       cmsg = cmsg.replace('%s', '<%#$this->Data['resource_type']%>');
+                                       cmsg = cmsg.replace('%s', '<%#$this->Data['resource_name']%>');
                                        if ((/^<%=$this->RemoveResource->ClientID%>/.test(t.id) || nn == 'I') && confirm(cmsg)) {
                                                return true;
                                        }
@@ -35,7 +35,7 @@
                                                        ClientSide.OnLoading="BaculaConfig.loader_start(sender.options.ID);"
                                                        ClientSide.OnComplete="BaculaConfig.set_config_items(sender.options.ID);"
                                                        Attributes.onclick="return BaculaConfig.unset_config_items(this.id);"
-                                                       Text="<strong><%=$this->Data['resource_type']%></strong>: <%=$this->Data['resource_name']%>"
+                                                       Text="<strong><%#$this->Data['resource_type']%></strong>: <%#$this->Data['resource_name']%>"
                                                        Style="text-decoration: none"
                                                />
                                                        <i class="fa fa-sync w3-spin" style="display: none"></i>
index 3857baa81f7b31a4cd81a53d77a48f8a2eaec559..9426f065de5cfa81638970fc9be676b6ea8133d7 100644 (file)
@@ -21,8 +21,8 @@
                                                </com:TActiveLinkButton>
                                                        <i class="fa fa-sync w3-spin" style="display: none"><i/>
                                                </td>
-                                               <td style="width: 45%"><%[ IP Address/Hostname: ]%><strong> <%=$this->getParent()->getParent()->config[$this->Data]['address']%></strong></td>
-                                               <td style="width: 10%"><%[ Port: ]%><strong> <%=$this->getParent()->getParent()->config[$this->Data]['port']%></strong>
+                                               <td style="width: 45%"><%[ IP Address/Hostname: ]%><strong> <%#$this->getParent()->getParent()->config[$this->Data]['address']%></strong></td>
+                                               <td style="width: 10%"><%[ Port: ]%><strong> <%#$this->getParent()->getParent()->config[$this->Data]['port']%></strong>
                                                </td>
                                                <td style="width: 15%"><com:TActiveLinkButton
                                                        ID="RemoveHost"
index 01c145f5c14b6c130f75dc2e60d4aea0a28b8bec..73ee332f38bef048bd24d330ca7586d4f8035bff 100644 (file)
@@ -177,6 +177,10 @@ class DirectiveMessages extends DirectiveListTemplate {
        }
 
        public function createDirectiveListElement($sender, $param) {
+               if (!is_array($param->Item->Data)) {
+                       // skip parent repeater items
+                       return;
+               }
                for ($i = 0; $i < count($this->directive_types); $i++) {
                        $control = $this->getChildControl($param->Item, $this->directive_types[$i]);
                        if (is_object($control)) {
index b0158f2e5934164874b91c304745bba2b78371e3..fbb39cff89c9b09c3ec6c517f52c58d77f149311 100644 (file)
@@ -12,7 +12,7 @@
                        >
                                <i class="fa fa-trash-alt"></i> &nbsp;<%[ Remove ]%>
                        </com:TActiveLinkButton>
-                       <h2><%=$this->Data['directive_name']%></h2>
+                       <h2><%#$this->Data['directive_name']%></h2>
                        <com:Application.Web.Portlets.DirectiveTextBox />
                        <com:Application.Web.Portlets.MessageTypes ID="Types" />
                </div>
index eb7951869533737a8cc554084702b1f16b095661..017b652415a011e300b0c352a5f79e3254834b0f 100644 (file)
@@ -58,6 +58,10 @@ class MessageTypes extends DirectiveListTemplate {
        }
 
        public function createTypeListElement($sender, $param) {
+               if (!is_array($param->Item->Data)) {
+                       // skip parent repeater items
+                       return;
+               }
                $control = $this->getChildControl($param->Item, 'DirectiveCheckBox');
                if (is_object($control)) {
                        $control->setHost($param->Item->Data['host']);