Procházet zdrojové kódy

fixed print links in Kosztorys routes

Piotr Labudda před 9 roky
rodič
revize
928aa92190

+ 2 - 9
SE/se-lib/Route/ProjektyKosztorysBase.php

@@ -699,9 +699,8 @@ SQL_FUN;
 				if ($idProject > 0) {
 					$activeRoute = V::get('_route', '', $_GET);
 					$route = 'UrlAction_ProjektyKosztorys'; UI::link('default', "Kosztorys", "index.php?_route={$route}&ID_PROJECT={$idProject}", ['className'=>['active'=>($route == $activeRoute)]]);
-					UI::link('default', "Przedmiar", "index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT={$idProject}&_task=przedmiar&_print=1");
-					UI::link('default', "Przedmiar", "index.php?_route=UrlAction_ProjektyPrzedmiarKosztorys&ID_PROJECT={$idProject}&_print=1");
-					UI::link('default', "zestawienie (światłowód i mikrorurki)", "index.php?_route=UrlAction_ProjektyZestawienieSwMikRurKosztorys&ID_PROJECT={$idProject}&_print=1");
+					$route = 'UrlAction_ProjektyPrzedmiarKosztorys'; UI::link('default', "Przedmiar", "index.php?_route={$route}&ID_PROJECT={$idProject}&_print=1", ['className'=>['active'=>($route == $activeRoute)]]);
+					$route = 'UrlAction_ProjektyZestawienieSwMikRurKosztorys'; UI::link('default', "zestawienie (światłowód i mikrorurki)", "index.php?_route={$route}&ID_PROJECT={$idProject}&_print=1", ['className'=>['active'=>($route == $activeRoute)]]);
 					// UI::link('warning', "oferta", "index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT={$idProject}&_task=oferta", ['target'=>'_blank']);
 					// UI::link('warning', "oferta (Admin)", "index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT={$idProject}&_task=ofertaAdmin", ['target'=>'_blank']);
 					// UI::link('warning', "oferta company", "index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT={$idProject}&_task=ofertaCompany", ['target'=>'_blank']);
@@ -710,12 +709,6 @@ SQL_FUN;
 				UI::link('default', "oferta domyślna (Admin)", "index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&_task=ofertaDefaultAdmin", ['target'=>'_blank']);
 			UI::endTag('div');// .btn-group
 			UI::endTag('div');
-			UI::startTag('div');
-				switch ($task) {
-				case 'oferta': break;
-				case '': ?><a class="btn btn-link" href="index.php?_route=UrlAction_ProjektyKosztyWstepnychRobot&ID_PROJECT=<?php echo $idProject; ?>&_print=1" target="_blank"><i class="glyphicon glyphicon-print"></i> Wydruk Kosztorysu</a><?php break;
-				}
-			UI::endTag('div');
 		UI::endTag('div');// .container
 		UI::endTag('div');// .jumbotron
 ?>

+ 6 - 0
SE/se-lib/Route/UrlAction/ProjektyKosztorys.php

@@ -21,6 +21,12 @@ class Route_UrlAction_ProjektyKosztorys extends Route_ProjektyKosztorysBase {
 			$idCompany = V::get('ID_COMPANY', 0, $_REQUEST, 'int');
 			if (!$idProject) throw new Exception("Wrong param in 'ID_PROJECT' - expected integer!");
 			$this->panel($idProject, $idCompany);
+
+			if (1 != V::get('_print', '', $_GET)) {
+				UI::startContainer(['style'=>'text-align:right']);
+				UI::link('link', "<i class=\"glyphicon glyphicon-print\"></i> Drukuj", Request::getPathUri() . "index.php?_route=UrlAction_ProjektyKosztorys&ID_PROJECT={$idProject}&_print=1");
+				UI::endContainer();
+			}
 			$this->kosztorys($idProject, $idCompany);
 		} catch (Exception $e) {
 			UI::alert('danger', "Error #" . $e->getCode() .  "|" . $e->getLine() .  ": " . $e->getMessage());

+ 5 - 5
SE/se-lib/Route/UrlAction/ProjektyPrzedmiarKosztorys.php

@@ -20,6 +20,11 @@ class Route_UrlAction_ProjektyPrzedmiarKosztorys extends Route_ProjektyKosztorys
 			$idProject = V::get('ID_PROJECT', 0, $_REQUEST, 'int');
 			if (!$idProject) throw new Exception("Wrong param in 'ID_PROJECT' - expected integer!");
 			$this->panel($idProject);
+			if (1 != V::get('_print', '', $_GET)) {
+				UI::startContainer(['style'=>'text-align:right']);
+				UI::link('link', "<i class=\"glyphicon glyphicon-print\"></i> Drukuj", Request::getPathUri() . "index.php?_route=UrlAction_ProjektyPrzedmiarKosztorys&ID_PROJECT={$idProject}&_print=1");
+				UI::endContainer();
+			}
 			$this->przedmiar($idProject);
 		} catch (Exception $e) {
 			UI::alert('danger', "Error #" . $e->getCode() .  "|" . $e->getLine() .  ": " . $e->getMessage());
@@ -40,11 +45,6 @@ class Route_UrlAction_ProjektyPrzedmiarKosztorys extends Route_ProjektyKosztorys
 		$hidePrices = true;
 		$viewLayerDataArgs = compact('idProject', 'idCompany', 'admin', 'companyAdmin', 'hidePrices');
 		UI::setTitleJsTag("Przedmiar robót telekomunikacyjnych [{$idProject}]");
-		if (1 != V::get('_print', '', $_GET)) {
-			UI::startContainer(['style'=>'text-align:right']);
-			UI::link('link', "<i class=\"glyphicon glyphicon-print\"></i> Drukuj", Request::getPathUri() . "index.php?_route=UrlAction_ProjektyPrzedmiarKosztorys&ID_PROJECT={$idProject}&_print=1");
-			UI::endContainer();
-		}
 ?>
 <div class="container">
 	<h1>Przedmiar robót telekomunikacyjnych</h1>

+ 5 - 0
SE/se-lib/Route/UrlAction/ProjektyZestawienieSwMikRurKosztorys.php

@@ -20,6 +20,11 @@ class Route_UrlAction_ProjektyZestawienieSwMikRurKosztorys extends Route_Projekt
 			$idProject = V::get('ID_PROJECT', 0, $_REQUEST, 'int');
 			if (!$idProject) throw new Exception("Wrong param in 'ID_PROJECT' - expected integer!");
 			$this->panel($idProject);
+			if (1 != V::get('_print', '', $_GET)) {
+				UI::startContainer(['style'=>'text-align:right']);
+				UI::link('link', "<i class=\"glyphicon glyphicon-print\"></i> Drukuj", Request::getPathUri() . "index.php?_route=UrlAction_ProjektyZestawienieSwMikRurKosztorys&ID_PROJECT={$idProject}&_print=1");
+				UI::endContainer();
+			}
 			$this->zestawienieSwMikRur($idProject);
 		} catch (Exception $e) {
 			UI::alert('danger', "Error #" . $e->getCode() .  "|" . $e->getLine() .  ": " . $e->getMessage());