Просмотр исходного кода

zmiany interfejsu operacyjna baza danych i schowanie go

michalzmijewski 7 лет назад
Родитель
Сommit
9ad34fa509
3 измененных файлов с 85 добавлено и 9 удалено
  1. 28 6
      theme/view/home.php
  2. 53 1
      tools/Bocian.php
  3. 4 2
      tools/Bocian.php.addItemToRaport.js

+ 28 - 6
theme/view/home.php

@@ -1,4 +1,5 @@
 <!-- start: home -->
+<!--
 <ul class="nav nav-tabs" style="margin-bottom: 20px">
   <li class="nav-item">
     <a id="oip" class="nav-link active" href="#">OSOBY I PODMIOTY</a>
@@ -7,6 +8,7 @@
     <a id="obz" class="nav-link" href="#">OPER. BAZA ZGŁOSZEŃ</a>
   </li>
 </ul>
+-->
 <div id="smad-page-home" class="container-fluid">
     <div>
         <div>
@@ -39,12 +41,32 @@
                     <div id="smad-menu-form-section">
                         <div class="col-md-12 padding-lr-0 smad-border-col">
                             <div class="menu-items text-center">
-                                <div class="menu-item">
-                                    <a href="index.php?_route=UrlAction_Bocian#OPERACYJNA_BAZA_ZGLOSZEN" title="Operacyjna baza zgłoszeń">
-                                        <div>OPERACYJNA BAZA ZGŁOSZEŃ</div>
-                                        <img src="<?= $this->asset("assets/images/button-red.png"); ?>" alt="Operacyjna baza zgłoszeń" onmouseover="this.src='<?= $this->asset("assets/images/button-red-border.png"); ?>'" onmouseout="this.src='<?= $this->asset("assets/images/button-red.png"); ?>'"
-         />
-                                    </a>
+                                <div class="container-fluid">
+                                    <ul class="breadcrumb">
+                                      <li>
+                                        <a href="#" onclick="">Operacyjna baza zgłoszeń</a>
+                                      </li>
+                                      <li>
+                                        <a href="index.php?_route=UrlAction_Bocian#KONTRAHENCI">
+                                          <span class="glyphicon glyphicon-plus"></span>
+                                          Dodaj nowy rekord
+                                        </a>
+                                      </li>
+                                    </ul>
+                                    <div class="padding-0 smad-employees-obz-head" style="background-color:lightgrey;">
+                                      <div class "col-md-6">
+                                        <h2 class="title" style="padding: 30px"> Operacyjna baza zgłoszeń</h2>
+                                      </div>
+                                      <div class="container-fluid">
+                                        <div class="table-responsive padding-0" id="smad-table-obz">
+                                          <table class="table table-responsive table-bordered table-hover table-striped" height="5">
+                                            <thead>
+                                            </thead>
+                                          </table>
+                                        </div>
+                                      </div>
+                                    </div>
+
                                 </div>
                             </div>
                         </div>

+ 53 - 1
tools/Bocian.php

@@ -204,7 +204,7 @@ TODO: dodać możliwość wysyłania maila używajac mail()
 			'DBG' => V::get('DBG', 0, $_GET),
 			'VIEW_KONTRAHENCI' => $this->defaultViewFormBiAudit([], 'KONTRAHENCI'),
 			'VIEW_PRACOWNICY' => $this->defaultViewFormBiAudit([], 'PRACOWNICY'),
-			'VIEW_OPERACYJNA_BAZA_ZGLOSZEN' => $this->defaultViewFormBiAudit([], 'PRACOWNICY'),
+			'VIEW_OPERACYJNA_BAZA_ZGLOSZEN' => $this->defaultViewFormBiAudit([], 'OPERACYJNA_BAZA_ZGLOSZEN'),
 			'URL_FORM_DATA_CSV_FILE_AJAX' => $this->getLink('formDataCsvFileAjax'),
 			'URL_SAVE_FORM_CSV_FILE_AJAX' => $this->getLink('saveFormCsvFileAjax'),
 			'URL_TABLE_POWIAZANIA' => Router::getRoute('ViewTableAjax', [ 'namespace' => "default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA" ]),
@@ -1803,6 +1803,58 @@ public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) {
 					DBG::log($fieldLabels, 'array', "fieldLabels (KONTRAHENCI)");
 				break;
 
+				case 'OPERACYJNA_BAZA_ZGLOSZEN':
+
+					$activeFormStepsKontrahent = 'complete';
+
+					$titleHeader = 'KONTRAHENCI/PODMIOTY';
+
+					$groupFilterList = '
+					<div class="menu-item">
+							<ul class="padding-0">
+									<li><a href="#" title="STWÓRZ GRUPĘ" class="btn btn-default" onClick="createGroupKontrahenci(event)" data-color-noactive="">+ STWÓRZ GRUPĘ</a></li>
+							</ul>
+					</div>
+					<div id="group-kontrahenci" class="btn-group">
+							<button class="btn btn-default active" title="Wszyscy" data-group-filter="0">Wszyscy</button>
+					</div>';
+
+					$formSmadDepth = '<input type="text" class="form-control smad-depth-kontrahenci" placeholder="1-16" value="" />';
+
+					$formSmadSelectTarget = '<select class="form-control" id="smad-select-target-kontrahenci"><option value="y">tak</option><option value="n">nie</option></select>';
+
+					$formFilterHeadTitle = '<h2 class="title" id="smad-filter-head-title-kontrahenci">Wszyscy</h2>';
+					$formFilterHeadDesc = '<p>Liczba pozycji na liście: <span id="smad-filter-desc-kontrahenci">0</span></p>';
+					$countSelectedItem = '<div>Wybrano: <span id="count-selected-item-kontrahenci">0</span> <span><a title="wyczyść zapamietanych kontrahentów"  class="link-primary" onClick="clearListLocalStorageByType(\'kontrahenci\')"><small>(wyczyść)</small></a></span></div>';
+
+					$graphView = '<div class="smad-kontrahenci-graph-view" style="display: none;"></div>';
+
+					$csvExampleKontrahenci = Request::getPathUri() . 'projects/bocian/theme/assets/file_example/kontrahenci_example.zip';
+					$formAddNewData ='
+					<li><a title="IMPORT KONTRAHENCI" onClick="showViewUploadFile(event, \'Import podmiotów/kontrahentów\', \'kontrahenci\', \'no\', \''.$csvExampleKontrahenci.'\' )" class="btn btn-info">IMPORT KONTRAHENCI</a></li>
+					<li><a title="DODAJ KONTRAHENCI" onClick="createKontrahentAjax(event)" class="btn btn-info">+ DODAJ PODMIOT</a></li>'; //todo: dodać obsługe doddawania kontrahentow
+
+					$buttonMoveToGroup = '<a title="DODAJ WYBRANE DO GRUPY" onClick="addKontrahenciToGroup(event)" class="btn btn-info">DODAJ WYBRANE DO GRUPY</a>';
+					$buttonMoveToGroup .= '<a title="DODAJ WSZYSTKIE DO GRUPY" onClick="addKontrahenciAllToGroup(event)" class="btn btn-info" style="margin-left:12px">DODAJ WSZYSTKIE DO GRUPY</a>';
+					$buttonMoveToGroup .= '<a title="USUN WYBRANE Z GRUPY" onClick="removeKontrahenciFromGroup(event)" class="btn btn-info" style="margin-left:12px">USUŃ WYBRANE Z GRUPY</a>';
+
+					$formSmadReaportTitleInput = '<input type="text" class="form-control smad-reaport-title-kontrahenci" placeholder="Default reaport" value="" />';
+
+					$showButtonNextStep = '';
+
+					$pagination_form = '<div id="pagination-kontrahenci"></div>';
+
+					$acl = ACL::getAclByNamespace("default_db/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI");
+					$fieldList = $acl->getRealFieldList();
+					$fieldLabels = array_combine(
+						$fieldList,
+						array_map(function ($fieldName) use ($acl) {
+							return $acl->getFieldLabel($fieldName);
+						}, $fieldList)
+					);
+					DBG::log($fieldLabels, 'array', "fieldLabels (KONTRAHENCI)");
+				break;
+
 				case 'PRACOWNICY':
 					$titleHeader = 'OSOBY';
 

+ 4 - 2
tools/Bocian.php.addItemToRaport.js

@@ -33,6 +33,7 @@ var P5UI_AddItemToReport = createReactClass({
     },
     _handleSearch: function (query) {
         this.setState({ isSearching: true });
+        //Baza= this.state.baza;
         setTimeout(function () {
             var options = [];
             options.push({
@@ -51,7 +52,7 @@ var P5UI_AddItemToReport = createReactClass({
                 searchLabel: "BIZNESLIMIT.PL SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ ELIASZA RADZIKOWSKIEGO 74/16, 31-315 KRAKÓW 0000721708 9452218050 369608402",
                 label: "BIZNESLIMIT.PL ..., ELIASZA RADZIKOWSKIEGO 74/16, 31-315 KRAKÓW"
             })
-            this.setState({ isSearching: true, options: options });
+            this.setState({ isSearching: false, options: options });
         }.bind(this), 1000);
         // makeAndHandleRequest(query)
         //   .then(({ options }) => {
@@ -163,7 +164,7 @@ var P5UI_AddItemToReport = createReactClass({
                 h('button', {
                     className: "btn btn-success active",
                     onClick: function () {
-
+                        //this.props.onSelect(this.state.baza, this.state.selected)
                         ReactDOM.unmountComponentAtNode(document.getElementById('createPracownikAjax__searchBaza'));
                         swal.close()
                     }
@@ -203,6 +204,7 @@ function createPracownikAjax(event) {
             ReactDOM.render(
                 h(P5UI_AddItemToReport, {
                     onSelect: function (baza, selected) {
+                        //insert do tabeli BI_audit_ENERGA_PRACOWNICY
                         console.log('TODO: selected ', { baza, selected });
                     }
                 }),