Commit 8bf2eea3 authored by Evren Kutar's avatar Evren Kutar

download reports

parent ed4a4025
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
Hepsini Seç Hepsini Seç
</label> </label>
</td> </td>
<td ng-repeat="value in objects[0]" ng-if="objects[0]!='-1'">{{value}}</td> <td ng-repeat="value in objects[0] track by $index" ng-if="objects[0]!='-1'">{{value}}</td>
<td ng-if="objects[0]=='-1'">{{ schema.title||model}}</td> <td ng-if="objects[0]=='-1'">{{ schema.title||model}}</td>
<td>action</td> <td>action</td>
</tr> </tr>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</td> </td>
<td> <td>
<button class="btn btn-info" style="margin-right: 5px;" ng-repeat="action in object.actions" <button class="btn btn-info" style="margin-right: 5px;" ng-repeat="action in object.actions track by $index"
ng-if="action.show_as==='button'" ng-if="action.show_as==='button'"
ng-click="do_action(object.key, action)">{{action ng-click="do_action(object.key, action)">{{action
.name}} .name}}
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="col-md-4 col-md-offset-4 text-center"> <div class="col-md-4 col-md-offset-4 text-center">
<img class="img-circle user-pic" src="{{$root.current_user.avatar}}" alt="{{$root.current_user.username}}"> <img class="img-circle user-pic" src="{{$root.current_user.avatar}}"
alt="{{$root.current_user.username}}">
<p class="user-name">{{$root.current_user.name}} {{$root.current_user.surname}}</p> <p class="user-name">{{$root.current_user.name}} {{$root.current_user.surname}}</p>
</div> </div>
</div> </div>
...@@ -25,8 +26,9 @@ ...@@ -25,8 +26,9 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="col-md-6 text-center link-buttons" ng-repeat="menu in $root.quick_menu"> <div class="col-md-6 text-center link-buttons" ng-repeat="menu in $root.quick_menu">
<a ng-href="#/{{menu[0].wf}}/{{menu[0].model}}?{{menu[0].param}}={{selectedUser.key}}"> <a ng-repeat="item in menu"
{{menu[0].text}} ng-href="#/{{item.wf}}/{{item.model}}?{{item.param}}={{selectedUser.key}}">
{{item.text}}
</a> </a>
</div> </div>
</div> </div>
...@@ -38,7 +40,7 @@ ...@@ -38,7 +40,7 @@
<div class="dashboard-main-search clearfix"> <div class="dashboard-main-search clearfix">
<div class="row" ng-if="$root.current_user.is_staff"> <div class="row" ng-show="$root.current_user.is_staff">
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
...@@ -47,7 +49,7 @@ ...@@ -47,7 +49,7 @@
<div class="panel-body"> <div class="panel-body">
<div class="dashboard-student-search" data-step="2" <div class="dashboard-student-search" data-step="2"
data-intro="isim veya tcno ile öğrenci araması yapabilirsiniz." data-intro="isim veya tcno ile öğrenci araması yapabilirsiniz."
ng-show="menuitems.ogrenci"> ng-show="$root.searchInputs.ogrenci">
<div class="text-center"> <div class="text-center">
<h3>ÖĞRENCİ</h3> <h3>ÖĞRENCİ</h3>
<input type="text" placeholder="Öğrenci ara" ng-model="keyword.student" <input type="text" placeholder="Öğrenci ara" ng-model="keyword.student"
...@@ -69,7 +71,8 @@ ...@@ -69,7 +71,8 @@
</div> </div>
<!-- end of dashboard-student-search --> <!-- end of dashboard-student-search -->
<div class="dashboard-personnel-search" data-step="3" <div class="dashboard-personnel-search" data-step="3"
data-intro="isim veya tcno ile personel araması yapabilirsiniz." ng-show="menuitems.personel"> data-intro="isim veya tcno ile personel araması yapabilirsiniz."
ng-show="$root.searchInputs.personel">
<div class="text-center"> <div class="text-center">
<h3>PERSONEL</h3> <h3>PERSONEL</h3>
<input type="text" placeholder="Personel ara" ng-model="keyword.staff" <input type="text" placeholder="Personel ara" ng-model="keyword.staff"
......
...@@ -20,7 +20,7 @@ angular.module('ulakbus.dashboard', []) ...@@ -20,7 +20,7 @@ angular.module('ulakbus.dashboard', [])
// to show search box based on authz // to show search box based on authz
$scope.$on("authz", function (event, data) { $scope.$on("authz", function (event, data) {
$scope.menuitems = data; $rootScope.searchInputs = data;
}); });
$scope.keyword = {student: "", staff: ""}; $scope.keyword = {student: "", staff: ""};
......
...@@ -117,8 +117,7 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -117,8 +117,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
model: $scope.$parent.form_params.model, model: $scope.$parent.form_params.model,
cmd: $scope.$parent.reload_cmd, cmd: $scope.$parent.reload_cmd,
flow: $scope.$parent.form_params.flow, flow: $scope.$parent.form_params.flow,
param: 'query', query: $scope.searchModel.searchbox
id: $scope.searchModel.searchbox
} }
}; };
...@@ -310,7 +309,7 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -310,7 +309,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
restrict: 'E', restrict: 'E',
replace: true, replace: true,
scope: {}, scope: {},
controller: function ($scope, $rootScope, $cookies, $route, $http, RESTURL, $location, $window, $timeout) { controller: function ($scope, $rootScope, $cookies, $route, $http, RESTURL, $log, $location, $window, $timeout) {
$scope.prepareMenu = function (menuItems) { $scope.prepareMenu = function (menuItems) {
var newMenuItems = {}; var newMenuItems = {};
angular.forEach(menuItems, function (value, key) { angular.forEach(menuItems, function (value, key) {
...@@ -349,6 +348,7 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -349,6 +348,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
$rootScope.quick_menu = reGroupMenuItems(data.quick_menu, 'quick_menus'); $rootScope.quick_menu = reGroupMenuItems(data.quick_menu, 'quick_menus');
delete data.quick_menu; delete data.quick_menu;
$log.debug('quick menu', $rootScope.quick_menu);
// broadcast for authorized menu items, consume in dashboard to show search inputs and/or // broadcast for authorized menu items, consume in dashboard to show search inputs and/or
// related items // related items
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
sf-changed="form" sf-changed="form"
class="form-control {{form.fieldHtmlClass}}" class="form-control {{form.fieldHtmlClass}}"
schema-validate="form" schema-validate="form"
ng-change="form.fileInsert()"
name="{{form.name}}"/> name="{{form.name}}"/>
</div> </div>
......
...@@ -20,7 +20,7 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -20,7 +20,7 @@ angular.module('formService', ['ui.bootstrap'])
* @description * @description
* form service's Generator factory service handles all generic form operations * form service's Generator factory service handles all generic form operations
*/ */
.factory('Generator', function ($http, $q, $timeout, $location, $route, $compile, $log, RESTURL, $rootScope) { .factory('Generator', function ($http, $q, $timeout, $sce, $location, $route, $compile, $log, RESTURL, $rootScope) {
var generator = {}; var generator = {};
/** /**
* @name makeUrl * @name makeUrl
...@@ -213,7 +213,9 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -213,7 +213,9 @@ angular.module('formService', ['ui.bootstrap'])
templateUrl: "shared/templates/filefield.html", templateUrl: "shared/templates/filefield.html",
name: k, name: k,
key: k, key: k,
titleMap: v.titleMap fileInsert: function () {
$scope.$broadcast('schemaForm.error.' + k, 'tv4-302', true);
}
}; };
v.type = 'string'; v.type = 'string';
} }
...@@ -904,7 +906,18 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -904,7 +906,18 @@ angular.module('formService', ['ui.bootstrap'])
}; };
return $http.post(generator.makeUrl($scope), data) return $http.post(generator.makeUrl($scope), data)
.success(function (data) { .success(function (data, status, headers) {
if (headers('content-type') === "application/pdf") {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
var file = new Blob([data], {type: 'application/pdf'});
var fileURL = URL.createObjectURL(file);
var fileName = $scope.schema.title;
a.href = fileURL;
a.download = fileName;
a.click();
}
if (redirectTo === true) { if (redirectTo === true) {
if (data.client_cmd) { if (data.client_cmd) {
generator.pathDecider(data.client_cmd, $scope, data); generator.pathDecider(data.client_cmd, $scope, data);
......
This diff is collapsed.
This diff is collapsed.
...@@ -181,7 +181,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache", ...@@ -181,7 +181,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" Hepsini Seç\n" + " Hepsini Seç\n" +
" </label>\n" + " </label>\n" +
" </td>\n" + " </td>\n" +
" <td ng-repeat=\"value in objects[0]\" ng-if=\"objects[0]!='-1'\">{{value}}</td>\n" + " <td ng-repeat=\"value in objects[0] track by $index\" ng-if=\"objects[0]!='-1'\">{{value}}</td>\n" +
" <td ng-if=\"objects[0]=='-1'\">{{ schema.title||model}}</td>\n" + " <td ng-if=\"objects[0]=='-1'\">{{ schema.title||model}}</td>\n" +
" <td>action</td>\n" + " <td>action</td>\n" +
" </tr>\n" + " </tr>\n" +
...@@ -202,7 +202,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache", ...@@ -202,7 +202,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" </td>\n" + " </td>\n" +
"\n" + "\n" +
" <td>\n" + " <td>\n" +
" <button class=\"btn btn-info\" style=\"margin-right: 5px;\" ng-repeat=\"action in object.actions\"\n" + " <button class=\"btn btn-info\" style=\"margin-right: 5px;\" ng-repeat=\"action in object.actions track by $index\"\n" +
" ng-if=\"action.show_as==='button'\"\n" + " ng-if=\"action.show_as==='button'\"\n" +
" ng-click=\"do_action(object.key, action)\">{{action\n" + " ng-click=\"do_action(object.key, action)\">{{action\n" +
" .name}}\n" + " .name}}\n" +
...@@ -272,10 +272,10 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache", ...@@ -272,10 +272,10 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
$templateCache.put("components/dashboard/dashboard.html", $templateCache.put("components/dashboard/dashboard.html",
"<div ng-app=\"ulakbus.dashboard\" class=\"dashboard\">\n" + "<div ng-app=\"ulakbus.dashboard\" class=\"dashboard\">\n" +
" <div class=\"starter-template\">\n" + " <div class=\"starter-template\">\n" +
" \n" + "\n" +
" \n" + "\n" +
" <div class=\"row\">\n" + " <div class=\"row\">\n" +
" \n" + "\n" +
" <div class=\"col-md-6 user-info\">\n" + " <div class=\"col-md-6 user-info\">\n" +
" <div class=\"panel panel-default\">\n" + " <div class=\"panel panel-default\">\n" +
" <div class=\"panel-heading\">\n" + " <div class=\"panel-heading\">\n" +
...@@ -283,13 +283,14 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache", ...@@ -283,13 +283,14 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" </div>\n" + " </div>\n" +
" <div class=\"panel-body\">\n" + " <div class=\"panel-body\">\n" +
" <div class=\"col-md-4 col-md-offset-4 text-center\">\n" + " <div class=\"col-md-4 col-md-offset-4 text-center\">\n" +
" <img class=\"img-circle user-pic\" src=\"{{$root.current_user.avatar}}\" alt=\"{{$root.current_user.username}}\">\n" + " <img class=\"img-circle user-pic\" src=\"{{$root.current_user.avatar}}\"\n" +
" alt=\"{{$root.current_user.username}}\">\n" +
" <p class=\"user-name\">{{$root.current_user.name}} {{$root.current_user.surname}}</p>\n" + " <p class=\"user-name\">{{$root.current_user.name}} {{$root.current_user.surname}}</p>\n" +
" </div>\n" + " </div>\n" +
" </div>\n" + " </div>\n" +
" </div>\n" + " </div>\n" +
" </div>\n" + " </div>\n" +
" \n" + "\n" +
" <div class=\"col-md-6 quick-links\">\n" + " <div class=\"col-md-6 quick-links\">\n" +
" <div class=\"panel panel-default\">\n" + " <div class=\"panel panel-default\">\n" +
" <div class=\"panel-heading\">\n" + " <div class=\"panel-heading\">\n" +
...@@ -297,20 +298,21 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache", ...@@ -297,20 +298,21 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" </div>\n" + " </div>\n" +
" <div class=\"panel-body\">\n" + " <div class=\"panel-body\">\n" +
" <div class=\"col-md-6 text-center link-buttons\" ng-repeat=\"menu in $root.quick_menu\">\n" + " <div class=\"col-md-6 text-center link-buttons\" ng-repeat=\"menu in $root.quick_menu\">\n" +
" <a ng-href=\"#/{{menu[0].wf}}/{{menu[0].model}}?{{menu[0].param}}={{selectedUser.key}}\">\n" + " <a ng-repeat=\"item in menu\"\n" +
" {{menu[0].text}} \n" + " ng-href=\"#/{{item.wf}}/{{item.model}}?{{item.param}}={{selectedUser.key}}\">\n" +
" {{item.text}}\n" +
" </a>\n" + " </a>\n" +
" </div>\n" + " </div>\n" +
" </div>\n" + " </div>\n" +
" </div>\n" + " </div>\n" +
" </div>\n" + " </div>\n" +
" \n" + "\n" +
" </div>\n" + " </div>\n" +
" <!-- end of row -->\n" + " <!-- end of row -->\n" +
" \n" + "\n" +
" <div class=\"dashboard-main-search clearfix\">\n" + " <div class=\"dashboard-main-search clearfix\">\n" +
" \n" + "\n" +
" <div class=\"row\" ng-if=\"$root.current_user.is_staff\">\n" + " <div class=\"row\" ng-show=\"$root.current_user.is_staff\">\n" +
" <div class=\"col-md-12\">\n" + " <div class=\"col-md-12\">\n" +
" <div class=\"panel panel-default\">\n" + " <div class=\"panel panel-default\">\n" +
" <div class=\"panel-heading\">\n" + " <div class=\"panel-heading\">\n" +
...@@ -319,7 +321,7 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache", ...@@ -319,7 +321,7 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" <div class=\"panel-body\">\n" + " <div class=\"panel-body\">\n" +
" <div class=\"dashboard-student-search\" data-step=\"2\"\n" + " <div class=\"dashboard-student-search\" data-step=\"2\"\n" +
" data-intro=\"isim veya tcno ile öğrenci araması yapabilirsiniz.\"\n" + " data-intro=\"isim veya tcno ile öğrenci araması yapabilirsiniz.\"\n" +
" ng-show=\"menuitems.ogrenci\">\n" + " ng-show=\"$root.searchInputs.ogrenci\">\n" +
" <div class=\"text-center\">\n" + " <div class=\"text-center\">\n" +
" <h3>ÖĞRENCİ</h3>\n" + " <h3>ÖĞRENCİ</h3>\n" +
" <input type=\"text\" placeholder=\"Öğrenci ara\" ng-model=\"keyword.student\"\n" + " <input type=\"text\" placeholder=\"Öğrenci ara\" ng-model=\"keyword.student\"\n" +
...@@ -341,7 +343,8 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache", ...@@ -341,7 +343,8 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" </div>\n" + " </div>\n" +
" <!-- end of dashboard-student-search -->\n" + " <!-- end of dashboard-student-search -->\n" +
" <div class=\"dashboard-personnel-search\" data-step=\"3\"\n" + " <div class=\"dashboard-personnel-search\" data-step=\"3\"\n" +
" data-intro=\"isim veya tcno ile personel araması yapabilirsiniz.\" ng-show=\"menuitems.personel\">\n" + " data-intro=\"isim veya tcno ile personel araması yapabilirsiniz.\"\n" +
" ng-show=\"$root.searchInputs.personel\">\n" +
" <div class=\"text-center\">\n" + " <div class=\"text-center\">\n" +
" <h3>PERSONEL</h3>\n" + " <h3>PERSONEL</h3>\n" +
" <input type=\"text\" placeholder=\"Personel ara\" ng-model=\"keyword.staff\"\n" + " <input type=\"text\" placeholder=\"Personel ara\" ng-model=\"keyword.staff\"\n" +
...@@ -367,7 +370,7 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache", ...@@ -367,7 +370,7 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" </div>\n" + " </div>\n" +
" </div>\n" + " </div>\n" +
" </div>\n" + " </div>\n" +
" \n" + "\n" +
" </div>\n" + " </div>\n" +
" <!-- end of dashboard-main-search -->\n" + " <!-- end of dashboard-main-search -->\n" +
"\n" + "\n" +
...@@ -1544,6 +1547,7 @@ angular.module("shared/templates/filefield.html", []).run(["$templateCache", fun ...@@ -1544,6 +1547,7 @@ angular.module("shared/templates/filefield.html", []).run(["$templateCache", fun
" sf-changed=\"form\"\n" + " sf-changed=\"form\"\n" +
" class=\"form-control {{form.fieldHtmlClass}}\"\n" + " class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" schema-validate=\"form\"\n" + " schema-validate=\"form\"\n" +
" ng-change=\"form.fileInsert()\"\n" +
" name=\"{{form.name}}\"/>\n" + " name=\"{{form.name}}\"/>\n" +
" </div>\n" + " </div>\n" +
"\n" + "\n" +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment