From f0c63d9ba9ee859fd9818f428827e79c10b9fa40 Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Sun, 16 Aug 2026 19:33:19 +0300 Subject: [PATCH] Platform View Changes --- lib/controller/doPlatformOperations.php | 13 ++++++ lib/controller/getAddModuleWindow.php | 2 +- lib/controller/getMonitoringPlatformView.php | 6 ++- lib/controller/getPlatformEditor.php | 42 ++++++++++++++++++++ 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/lib/controller/doPlatformOperations.php b/lib/controller/doPlatformOperations.php index bb6f661..3fd2b4f 100644 --- a/lib/controller/doPlatformOperations.php +++ b/lib/controller/doPlatformOperations.php @@ -372,6 +372,19 @@ $LOG->reg_op( $_POST ); break; }; + case 19:{ // Change Layout + if( $OID == 0 ) { + $Data['msg']='Wrong Parameters!'; + echo json_encode( $Data ); + exit(); + }; + $LA = strtoupper( substr($_POST['OPCODE'], 0, 1 ) ); + $QS = "UPDATE `metro_platforms` SET `layout`='{$LA}' WHERE `id`={$OID}"; + $DATABASE->Query( $QS ); + $Data['success'] = true; + $LOG->reg_op( $_POST ); + break; + }; }; } else { $Data['msg']='Wrong Parameters!'; diff --git a/lib/controller/getAddModuleWindow.php b/lib/controller/getAddModuleWindow.php index ec4ee9c..8bb4f59 100644 --- a/lib/controller/getAddModuleWindow.php +++ b/lib/controller/getAddModuleWindow.php @@ -164,7 +164,7 @@ DATA_BOUNDARY; }; echo $WTPL; } else { - echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}'; + echo '{ xtype: \'panel\', html: \'No Tracks On Platform!\'}'; }; } else { header('location: /'); diff --git a/lib/controller/getMonitoringPlatformView.php b/lib/controller/getMonitoringPlatformView.php index f7717e4..aa8de9e 100644 --- a/lib/controller/getMonitoringPlatformView.php +++ b/lib/controller/getMonitoringPlatformView.php @@ -124,10 +124,10 @@ $CVTPL = str_ireplace( '%%%%TITLE%%%', $TTL, $CVTPL ); $CVTPL = str_ireplace( '%%%STATUS%CLASS%%', 'aaBB', $CVTPL ); $CVTPL = str_ireplace( '%%%IMG%URL%%%', $URL, $CVTPL ); - $CVTPL = str_ireplace( '%%%IMG%URL%%%', $URL, $CVTPL ); $CVTPL = str_ireplace( '%%MIP%%', $MM['IP4'], $CVTPL ); $CVTPL = str_ireplace( '%%MCID%%', $MM['cam_id'], $CVTPL ); - $ITEM = str_ireplace( '%%%VIDEO'.$CTRK['side'].$MM['side'].'%%%', $CVTPL, $ITEM ); + $CVTPL = str_ireplace( '%%%STATUS%%%', 'Status', $CVTPL ); + $ITEM = str_ireplace( '%%%VIDEO'.$CTRK['side'].$MM['side'].'%%%', $CVTPL, $ITEM ); $MODU_IDS[] = $MM['id']; }; } else { @@ -153,6 +153,8 @@ $CVTPL = str_ireplace( '%%%%TITLE%%%', $TTL, $CVTPL ); $CVTPL = str_ireplace( '%%%STATUS%CLASS%%', 'aaBB', $CVTPL ); $CVTPL = str_ireplace( '%%%IMG%URL%%%', $URL, $CVTPL ); + $CVTPL = str_ireplace( '%%MIP%%', $MM['IP4'], $CVTPL ); + $CVTPL = str_ireplace( '%%MCID%%', $MM['cam_id'], $CVTPL ); $CVTPL = str_ireplace( '%%%STATUS%%%', 'Status', $CVTPL ); $ITEM = str_ireplace( '%%%VIDEO'.$CTRK['side'].$MM['side'].'%%%', $CVTPL, $ITEM ); $MODU_IDS[] = $MM['id']; diff --git a/lib/controller/getPlatformEditor.php b/lib/controller/getPlatformEditor.php index 163c25f..b48b876 100644 --- a/lib/controller/getPlatformEditor.php +++ b/lib/controller/getPlatformEditor.php @@ -196,6 +196,47 @@ JOJOKA; doPlatformOperation( {$CR['id']}, 7, c, true ); } } + },{ + xtype: 'combo', + fieldLabel: "Platform Type", + id: 'pl_lay', + width: 200, + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + readOnly: false, + disableKeyFilter: true, + tpl:'
 {name}
', + store: new Ext.data.ArrayStore({ + fields: ['abbr','name','icon'], + data: [['A','Layout A','/style/assets/pt_layout_A.png'],['B','Layout B','/style/assets/pt_layout_B.png'],['C','Layout C','/style/assets/pt_layout_C.png'],['D','Layout D','/style/assets/pt_layout_D.png'],['E','Layout E','/style/assets/pt_layout_E.png'],['F','Layout F','/style/assets/pt_layout_F.png']] + }), + valueField: 'abbr', + displayField: 'name', + value: '{$CR['layout']}', + listeners:{ + select: function( t, r, i ){ + t.getEl().setStyle({ + 'background-image': 'url(' + r.data.icon + ')', + 'background-repeat': 'no-repeat', + 'background-position': '3px center', + 'background-size': '16px 16px', + 'padding-left': '25px' + }); + doPlatformOperation( {$CR['id']}, 19, r.data.abbr, true ); + }, + afterrender: function( t ){ + t.getEl().setStyle({ + 'background-image': 'url(' + t.store.data.items[t.store.findExact( 'abbr', t.value )].data.icon + ')', + 'background-repeat': 'no-repeat', + 'background-position': '3px center', + 'background-size': '16px 16px', + 'padding-left': '25px' + }); + } + } },{$ROUTING}] }] },{ @@ -209,6 +250,7 @@ JOJOKA; layout: 'hbox', items: [{ xtype: 'panel', + width: '40%', id: 'scada_container', tbar:[{ text: "{$Labels->GetLabel( '_ADD_' )}",