|
|
@@ -1,6 +1,8 @@
|
|
|
<?php
|
|
|
|
|
|
Lib::loadClass('RouteBase');
|
|
|
+Lib::loadClass('ProcesHelper');
|
|
|
+Lib::loadClass('TableAjax');
|
|
|
|
|
|
class Route_Budget extends RouteBase {
|
|
|
|
|
|
@@ -103,6 +105,13 @@ class Route_Budget extends RouteBase {
|
|
|
Pokaż
|
|
|
</button>
|
|
|
</form>
|
|
|
+ <div style="text-align:right">
|
|
|
+ Edytuj
|
|
|
+ <a href="index.php?_route=Budget&_task=plan&year=<?php echo $year; ?>"
|
|
|
+ class="btn btn-xs btn-default"
|
|
|
+ title="Plan budżetu (projects_budget_year_month)">plan budżetu</a>
|
|
|
+ na rok <?php echo $year; ?>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script type="text/javascript">
|
|
|
@@ -1090,4 +1099,89 @@ END
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function planAction() {
|
|
|
+ SE_Layout::gora();
|
|
|
+ SE_Layout::menu();
|
|
|
+
|
|
|
+ $args = array();
|
|
|
+ $args['year'] = V::get('year', '', $_REQUEST, 'int');
|
|
|
+ if ($args['year'] > 0) {
|
|
|
+ $_REQUEST['ff_YEAR'] = $_GET['ff_YEAR'] = $args['year'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->menu($args['year']);
|
|
|
+
|
|
|
+ if ($args['year'] > 0) {
|
|
|
+ ?>
|
|
|
+<div class="container">
|
|
|
+ <a class="btn btn-xs btn-default" href="#">Utwórz plan na kolejny rok na podstawie danych z <?php echo $args['year']; ?> roku</a>
|
|
|
+</div>
|
|
|
+<?php
|
|
|
+ }
|
|
|
+
|
|
|
+ $zasobObj = ProcesHelper::getZasobTableInfoByUri('default_db/projects_budget_year_month');
|
|
|
+ if (!$zasobObj) {
|
|
|
+ ?>
|
|
|
+<div class="alert alert-danger">
|
|
|
+ Zasob Tabela Plan budżetu (projects_budget_year_month) nie istnieje
|
|
|
+</div>
|
|
|
+<?php
|
|
|
+ // TODO: btn utwórz
|
|
|
+ SE_Layout::dol();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ $userAcl = User::getAcl();
|
|
|
+ $userAcl->fetchGroups();
|
|
|
+
|
|
|
+ if (!$userAcl->hasTableAcl($zasobObj->ID)) {
|
|
|
+ ?>
|
|
|
+<div class="alert alert-danger">
|
|
|
+ Brak uprawnień do tabeli Plan budżetu (projects_budget_year_month)
|
|
|
+</div>
|
|
|
+<?php
|
|
|
+ SE_Layout::dol();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ $tblAcl = $userAcl->getTableAcl($zasobObj->ID);
|
|
|
+
|
|
|
+ $forceTblAclInit = ('1' == V::get('_force', '', $_GET));
|
|
|
+ $tblAcl->init($forceTblAclInit);
|
|
|
+
|
|
|
+ $forceFilterInit = array();
|
|
|
+ $filterInit = new stdClass();
|
|
|
+ $filterInit->currSortCol = 'ID';
|
|
|
+ $filterInit->currSortFlip = 'desc';
|
|
|
+ foreach ($_GET as $k => $v) {
|
|
|
+ if (strlen($k) > 3 && substr($k, 0, 2) == 'f_' && !empty($v)) {// filter prefix
|
|
|
+ $filterInit->$k = $v;
|
|
|
+ }
|
|
|
+ else if (strlen($k) > 4 && substr($k, 0, 3) == 'sf_' && !empty($v)) {// special filter prefix
|
|
|
+ $filterInit->$k = $v;
|
|
|
+ }
|
|
|
+ else if (strlen($k) > 4 && substr($k, 0, 3) == 'ff_' && !empty($v)) {// force filter prefix
|
|
|
+ $fldName = substr($k, 3);
|
|
|
+ $forceFilterInit[$fldName] = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $tbl = new TableAjax($tblAcl);
|
|
|
+ $tblLabel = array();
|
|
|
+ if (!empty($zasobObj->DESC_PL)) $tblLabel []= $zasobObj->DESC_PL;
|
|
|
+ if (!empty($zasobObj->OPIS)) $tblLabel []= $zasobObj->OPIS;
|
|
|
+ $tblLabel = implode(" - ", $tblLabel);
|
|
|
+ $tbl->setLabel($tblLabel);
|
|
|
+ $tbl->setFilterInit($filterInit);
|
|
|
+ if (!empty($forceFilterInit)) $tbl->setForceFilterInit($forceFilterInit);
|
|
|
+ $tbl->addRowFunction('edit');
|
|
|
+ $tbl->addRowFunction('hist');
|
|
|
+ $tbl->addRowFunction('files');
|
|
|
+ $tbl->addRowFunction('cp');
|
|
|
+ $tbl->showProcesInit(false);
|
|
|
+ echo $tbl->render();
|
|
|
+
|
|
|
+ SE_Layout::dol();
|
|
|
+ }
|
|
|
+
|
|
|
}
|