Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    Kabel Listen Übersicht Tabelle mit Swicht und Port anpassen

    Scheduled Pinned Locked Moved Entwicklung
    1 Posts 1 Posters 1.5k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DigiDanielD Offline
      DigiDaniel
      last edited by

      Ahoi mal wieder! (-;

      In der Tabelle der Kabelübersicht hatte mir etwas wichtiges gefehlt. Und zwar das man direkt noch einmal einzeln sieht an welchen Switch und welchen entsprechenden Port ein bestimmtes Kabel angeschlossen ist. Ich habe in die Übersichtstabelle zwei weitere Spalten (Switch und Port) eingebaut:

      isys_cmdb_dao_list_objects_cable.class.php unter /htdocs/idoit/src/classes/cmdb/dao/list

       	public function get_fields() {
      		global $g_comp_template_language_manager;
      		global $g_modman;
      		global $g_lists;
      
      		$l_fields = array(
      		"object_title"   => $g_comp_template_language_manager->{"LC__CMDB__OBJTYPE__CABLE"} . " " . $g_comp_template_language_manager->{"LC__UNIVERSAL__TITLE"},
      		"switch"         => "Switch",
          	        "port"           => "Port",
                      "connection"     => "LC__CATG__STORAGE_FCPORT__CONNECTION",
      	 	);
      

      Hier lege ich zuerst meine gewünschten Spalten fest. Ich habe die Spalten "created", "updated" und "object_category" entfernt, da ich diese überflüssig finde.
      Hinzugefügt habe ich die Spalten "switch" und "port".

      Wieder isys_cmdb_dao_list_objects_cable.class.php unter /htdocs/idoit/src/classes/cmdb/dao/list

       		$l_condata = array();
       		while ($l_row = $l_connection->get_row()) {
      
            $l_condata[] = $l_row["isys_obj__title"]. " (" . $l_row["isys_catg_connector_list__title"] . ")";
            $l_condata2[] = $l_row["isys_catg_connector_list__title"];
            $l_condata3[] = $l_row["isys_obj__title"]. " (" . $l_row["isys_catg_connector_list__title"] . ")";
      
       		}
      
       		$p_row["cmdb_status"] = " ".
       									$g_comp_template_language_manager->get($p_row["isys_cmdb_status__title"]);
      
          $switch = implode("", $l_condata3); 
          $switch_2 = strchr ( $switch, "Switch" );
          $switch_3 = substr ( $switch_2, 0, 15);
          $p_row["switch"] = $switch_3; 
      
          $port_1 = implode("", $l_condata2); 
          $port_2 = strchr ( $port_1, "Port " );
          $port_3 = substr ( $port_2, 0, 10);
          $p_row["port"] = $port_3;  
      
          $p_row["connection"] = implode(" **<->** ", $l_condata);
      
       	}
      

      Hier lege ich die Daten fest (der Block mit switch und der Block mit port), die in meine eben "angelegten" Spalten geschrieben werde sollen. Ich will hier nicht ins Detail gehen, auf jeden Fall hole ich mir aus der jeweiligen Variablen $l_condata mit strchr die gewünschte Stelle im String (eben Port oder Switch) und mit substr beschneide ich diesen so, dass nur z. B "Switch 1" bzw. Port A 01" ausgegeben wird.

      Für Hilfe oder Fragen einfach antworten… (-;

      Daniel
      vorher.png
      nachher.png

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post