Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gredu_labs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
gredu_labs
Commits
29fb0a3d
Commit
29fb0a3d
authored
Feb 12, 2016
by
kanellov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some issues with staff
parent
ad15c8f7
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
144 additions
and
194 deletions
+144
-194
config/settings/schools.global.php
config/settings/schools.global.php
+1
-1
module/schools/bootstrap.php
module/schools/bootstrap.php
+22
-17
module/schools/bootstrap.php.orig
module/schools/bootstrap.php.orig
+0
-125
module/schools/public/js/schools/staff.js
module/schools/public/js/schools/staff.js
+11
-7
module/schools/src/Action/Index.php
module/schools/src/Action/Index.php
+1
-3
module/schools/src/Action/LabCreate.php
module/schools/src/Action/LabCreate.php
+5
-5
module/schools/src/Action/Staff.php
module/schools/src/Action/Staff.php
+10
-6
module/schools/src/Action/StaffCreate.php
module/schools/src/Action/StaffCreate.php
+15
-10
module/schools/src/Middleware/FetchSchoolFromIdentity.php
module/schools/src/Middleware/FetchSchoolFromIdentity.php
+38
-0
module/schools/src/Service/LabService.php
module/schools/src/Service/LabService.php
+16
-13
module/schools/src/Service/SchoolService.php
module/schools/src/Service/SchoolService.php
+3
-1
module/schools/src/Service/StaffService.php
module/schools/src/Service/StaffService.php
+16
-4
module/schools/src/Service/StaffServiceInterface.php
module/schools/src/Service/StaffServiceInterface.php
+1
-0
module/schools/templates/schools/staff.twig
module/schools/templates/schools/staff.twig
+2
-2
public/js/schools/staff.js
public/js/schools/staff.js
+3
-0
No files found.
config/settings/schools.global.php
View file @
29fb0a3d
...
...
@@ -13,7 +13,7 @@ return [
'routes'
=>
[
[
'/school'
,
[
'school'
],
[
'get'
]],
[
'/school/labs'
,
[
'school'
],
[
'get'
]],
[
'/school/staff'
,
[
'school'
],
[
'get'
]],
[
'/school/staff'
,
[
'school'
],
[
'get'
,
'post'
]],
[
'/school/assets'
,
[
'school'
],
[
'get'
]],
],
],
...
...
module/schools/bootstrap.php
View file @
29fb0a3d
...
...
@@ -54,28 +54,32 @@ return function (Slim\App $app) {
return
new
GrEduLabs\Schools\Action\Assets
(
$c
->
get
(
'view'
));
};
$container
[
'schoolservice'
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Service\SchoolService
();
$container
[
'schoolservice'
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Service\SchoolService
();
};
$container
[
'staffservice'
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Service\StaffService
(
$c
->
get
(
'schoolservice'
)
);
$container
[
'staffservice'
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Service\StaffService
(
$c
->
get
(
'schoolservice'
)
);
};
$container
[
'labservice'
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Service\LabService
(
$c
->
get
(
'schoolservice'
),
$c
->
get
(
'staffservice'
)
);
$container
[
'labservice'
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Service\LabService
(
$c
->
get
(
'schoolservice'
),
$c
->
get
(
'staffservice'
)
);
};
$container
[
'assetservice'
]
=
function
(
$c
){
return
new
GrEduLabs\Schools\Service\AssetService
(
$c
->
get
(
'schoolservice'
),
$c
->
get
(
'labservice'
)
);
$container
[
'assetservice'
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Service\AssetService
(
$c
->
get
(
'schoolservice'
),
$c
->
get
(
'labservice'
)
);
};
$container
[
GrEduLabs\Schools\Middleware\FetchSchoolFromIdentity
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Middleware\FetchSchoolFromIdentity
(
$c
[
'authentication_service'
]);
};
});
...
...
@@ -90,5 +94,6 @@ return function (Slim\App $app) {
$this
->
get
(
'/labs'
,
GrEduLabs\Schools\Action\Labs
::
class
)
->
setName
(
'school.labs'
);
$this
->
post
(
'/labs'
,
GrEduLabs\Schools\Action\LabCreate
::
class
)
->
setName
(
'school.labcreate'
);
$this
->
get
(
'/assets'
,
GrEduLabs\Schools\Action\Assets
::
class
)
->
setName
(
'school.assets'
);
});
})
->
add
(
GrEduLabs\Schools\Middleware\FetchSchoolFromIdentity
::
class
);
});
};
module/schools/bootstrap.php.orig
deleted
100644 → 0
View file @
ad15c8f7
<?php
/**
* gredu_labs.
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
*
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
return
function
(
Slim
\
App
$app
)
{
$container
=
$app
->
getContainer
();
$events
=
$container
[
'events'
];
<<<<<<<
HEAD
$events
(
'on'
,
'app.autoload'
,
function
(
$stop
,
$autoloader
)
{
$autoloader
->
addPsr4
(
'GrEduLabs\\Schools\\'
,
__DIR__
.
'/src/'
);
});
$events
(
'on'
,
'app.services'
,
function
(
$stop
,
$container
)
{
$container
[
GrEduLabs\Schools\Action\Index
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Index
(
$c
->
get
(
'view'
));
};
$container
[
GrEduLabs\Schools\Action\Staff
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Staff
(
$c
->
get
(
'view'
));
};
=======
$container
[
'autoloader'
]
->
addPsr4
(
'GrEduLabs\\Schools\\'
,
__DIR__
.
'/src/'
);
$container
[
GrEduLabs\Schools\Action\Index
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Index
(
$c
->
get
(
'view'
),
$c
->
get
(
'schoolservice'
)
);
};
$container
[
GrEduLabs\Schools\Action\Staff
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Staff
(
$c
->
get
(
'view'
),
$c
->
get
(
'staffservice'
)
);
};
$container
[
GrEduLabs\Schools\Action\StaffCreate
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\StaffCreate
(
$c
->
get
(
'staffservice'
)
);
};
$container
[
GrEduLabs\Schools\Action\Labs
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Labs
(
$c
->
get
(
'view'
)
);
};
$container
[
GrEduLabs\Schools\Action\LabCreate
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\LabCreate
(
$c
->
get
(
'labservice'
)
);
};
>>>>>>>
gtsakalos
/
modular
$container
[
GrEduLabs\Schools\Action\Labs
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Labs
(
$c
->
get
(
'view'
));
};
<<<<<<<
HEAD
$container
[
GrEduLabs\Schools\Action\Assets
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\Schools\Action\Assets
(
$c
->
get
(
'view'
));
};
});
=======
$container
[
'schoolservice'
]
=
function
(
$c
){
return
new
GrEduLabs\Schools\Service\SchoolService
();
};
$container
[
'staffservice'
]
=
function
(
$c
){
return
new
GrEduLabs\Schools\Service\StaffService
(
$c
->
get
(
'schoolservice'
)
);
};
$container
[
'labservice'
]
=
function
(
$c
){
return
new
GrEduLabs\Schools\Service\LabService
(
$c
->
get
(
'schoolservice'
),
$c
->
get
(
'staffservice'
)
);
};
$container
[
'assetservice'
]
=
function
(
$c
){
return
new
GrEduLabs\Schools\Service\AssetService
(
$c
->
get
(
'schoolservice'
),
$c
->
get
(
'labservice'
)
);
};
$events
=
$container
[
'events'
];
>>>>>>>
gtsakalos
/
modular
$events
(
'on'
,
'app.bootstrap'
,
function
(
$stop
,
$app
,
$container
)
{
$container
[
'view'
]
->
getEnvironment
()
->
getLoader
()
->
prependPath
(
__DIR__
.
'/templates'
);
<<<<<<<
HEAD
$app
->
group
(
'/school'
,
function
()
{
$this
->
get
(
''
,
GrEduLabs\Schools\Action\Index
::
class
)
->
setName
(
'school'
);
$this
->
get
(
'/staff'
,
GrEduLabs\Schools\Action\Staff
::
class
)
->
setName
(
'school.staff'
);
$this
->
get
(
'/labs'
,
GrEduLabs\Schools\Action\Labs
::
class
)
->
setName
(
'school.labs'
);
$this
->
get
(
'/assets'
,
GrEduLabs\Schools\Action\Assets
::
class
)
->
setName
(
'school.assets'
);
});
=======
$app
->
group
(
'/school'
,
function
()
{
$this
->
get
(
''
,
GrEduLabs\Schools\Action\Index
::
class
)
->
setName
(
'school'
);
$this
->
get
(
'/staff'
,
GrEduLabs\Schools\Action\Staff
::
class
)
->
setName
(
'school.staff'
);
$this
->
post
(
'/staff'
,
GrEduLabs\Schools\Action\StaffCreate
::
class
)
->
setName
(
'school.staffcreate'
);
$this
->
get
(
'/labs'
,
GrEduLabs\Schools\Action\Labs
::
class
)
->
setName
(
'school.labs'
);
$this
->
post
(
'/labs'
,
GrEduLabs\Schools\Action\LabCreate
::
class
)
->
setName
(
'school.labcreate'
);
$this
->
get
(
'/assets'
,
GrEduLabs\Schools\Action\Assets
::
class
)
->
setName
(
'school.assets'
);
>>>>>>>
gtsakalos
/
modular
});
};
module/schools/public/js/schools/staff.js
View file @
29fb0a3d
...
...
@@ -57,6 +57,7 @@
evt
.
preventDefault
();
this
.
modal
.
render
(
function
(
data
)
{
that
.
model
.
add
(
data
);
that
.
$el
.
find
(
'
.no-records
'
).
remove
();
});
return
this
;
},
...
...
@@ -109,15 +110,18 @@
hash
[
pair
.
name
]
=
pair
.
value
;
return
hash
;
},
{});
var
that
=
this
;
evt
.
preventDefault
();
if
(
!
data
.
id
)
{
data
.
id
=
(
100
*
Math
.
random
()).
toFixed
(
0
);
}
this
.
form
.
data
(
'
done
'
)(
data
);
this
.
form
.
data
(
'
done
'
,
undefined
);
this
.
hide
();
$
.
post
(
""
,
data
).
done
(
function
(
response
){
that
.
form
.
data
(
'
done
'
)(
response
);
that
.
form
.
data
(
'
done
'
,
undefined
);
that
.
hide
();
}).
fail
(
function
(
xhr
,
err
)
{
alert
(
xhr
.
statusText
);
});
}
});
new
StaffView
({
model
:
new
Staff
()
});
}());
\ No newline at end of file
}());
module/schools/src/Action/Index.php
View file @
29fb0a3d
...
...
@@ -25,9 +25,7 @@ class Index
public
function
__invoke
(
Request
$req
,
Response
$res
,
array
$args
=
[])
{
$identity
=
$req
->
getAttribute
(
'identity'
);
$user
=
\
RedBeanPHP\R
::
load
(
'user'
,
$identity
->
id
);
$school
=
$user
->
school
;
$school
=
$req
->
getAttribute
(
'school'
);
return
$this
->
view
->
render
(
$res
,
'schools/index.twig'
,
[
'school'
=>
$school
->
export
(),
...
...
module/schools/src/Action/LabCreate.php
View file @
29fb0a3d
...
...
@@ -24,18 +24,18 @@ class LabCreate
public
function
__invoke
(
Request
$req
,
Response
$res
,
array
$args
=
[])
{
$params
=
$req
->
getParams
();
if
(
array_key_exists
(
'id'
,
$params
))
{
if
(
array_key_exists
(
'id'
,
$params
))
{
$id
=
$params
[
'id'
];
unset
(
$params
[
'id'
]);
$id
=
$this
->
labservice
->
updateLab
(
$params
,
$id
);
$id
=
$this
->
labservice
->
updateLab
(
$params
,
$id
);
$lab
=
$this
->
labservice
->
getLabById
(
$id
);
}
else
{
$id
=
$this
->
labservice
->
createLab
(
$params
);
}
else
{
$id
=
$this
->
labservice
->
createLab
(
$params
);
$lab
=
$this
->
labservice
->
getLabById
(
$id
);
}
$res
=
$res
->
withJson
(
$lab
->
export
());
return
$res
;
}
}
module/schools/src/Action/Staff.php
View file @
29fb0a3d
...
...
@@ -20,24 +20,28 @@ class Staff
public
function
__construct
(
Twig
$view
,
$staffservice
)
{
$this
->
view
=
$view
;
$this
->
view
=
$view
;
$this
->
staffservice
=
$staffservice
;
}
public
function
__invoke
(
Request
$req
,
Response
$res
,
array
$args
=
[])
{
$staff
=
$this
->
staffservice
->
getTeachersBySchoolId
(
1
);
return
$this
->
view
->
render
(
$res
,
'schools/staff.twig'
,
[
'staff'
=>
$staff
,
'staff'
=>
array_map
(
function
(
$employee
)
{
return
array_merge
(
$employee
->
export
(),
[
'branch'
=>
$employee
->
branch
->
name
,
]);
},
$staff
),
'positions'
=>
[
[
'value'
=>
1
,
'label'
=>
'Εκπαδευτικός'
],
[
'value'
=>
2
,
'label'
=>
'Διευθυντής σχολείου'
],
[
'value'
=>
3
,
'label'
=>
'Υπεύθυνος εργαστηρίου'
],
],
'branches'
=>
[
[
'value'
=>
'branch1'
,
'label'
=>
'branch'
],
[
'value'
=>
'branch2'
,
'label'
=>
'branch2'
],
],
'branches'
=>
array_map
(
function
(
$branch
)
{
return
[
'value'
=>
$branch
[
'id'
],
'label'
=>
$branch
[
'name'
]];
},
$this
->
staffservice
->
getBranches
()),
]);
}
}
module/schools/src/Action/StaffCreate.php
View file @
29fb0a3d
...
...
@@ -23,24 +23,29 @@ class StaffCreate
public
function
__invoke
(
Request
$req
,
Response
$res
,
array
$args
=
[])
{
$school
=
$req
->
getAttribute
(
'school'
,
false
);
if
(
!
$school
)
{
return
$res
->
withStatus
(
403
,
'No school'
);
}
$params
=
$req
->
getParams
();
$id
=
$params
[
'id'
];
$id
=
$params
[
'id'
];
unset
(
$params
[
'id'
]);
if
(
$id
>
0
){
$id
=
$this
->
staffservice
->
updateTeacher
(
$params
,
$id
);
$params
[
'school_id'
]
=
$school
->
id
;
if
(
$id
>
0
)
{
$id
=
$this
->
staffservice
->
updateTeacher
(
$params
,
$id
);
$teacher
=
$this
->
staffservice
->
getTeacherById
(
$id
);
}
else
{
}
else
{
$id
=
$this
->
staffservice
->
createTeacher
(
$params
);
if
(
$id
>
0
){
if
(
$id
>
0
)
{
$teacher
=
$this
->
staffservice
->
getTeacherById
(
$id
);
}
}
if
(
isset
(
$teacher
)){
return
$res
->
withJson
(
$teacher
->
export
())
->
withStatus
(
201
);
}
else
{
if
(
isset
(
$teacher
))
{
return
$res
->
withJson
(
array_merge
(
$teacher
->
export
(),
[
'branch'
=>
$teacher
->
branch
->
name
,
]))
->
withStatus
(
201
);
}
else
{
return
$res
->
withStatus
(
400
);
}
}
...
...
module/schools/src/Middleware/FetchSchoolFromIdentity.php
0 → 100644
View file @
29fb0a3d
<?php
/**
* gredu_labs.
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
*
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace
GrEduLabs\Schools\Middleware
;
use
RedBeanPHP\R
;
class
FetchSchoolFromIdentity
{
protected
$authService
;
public
function
__construct
(
$authService
)
{
$this
->
authService
=
$authService
;
}
public
function
__invoke
(
$req
,
$res
,
$next
)
{
$identity
=
$this
->
authService
->
getIdentity
();
if
(
!
$identity
)
{
return
$res
->
withStatus
(
403
,
'No identity'
);
}
$user
=
R
::
load
(
'user'
,
$identity
->
id
);
if
(
!
(
$school
=
$user
->
school
))
{
return
$res
->
withStatus
(
403
,
'No school'
);
}
return
$next
(
$req
->
withAttribute
(
'school'
,
$school
),
$res
);
}
}
module/schools/src/Service/LabService.php
View file @
29fb0a3d
...
...
@@ -17,24 +17,22 @@ class LabService implements LabServiceInterface
protected
$staffService
;
public
function
__construct
(
SchoolServiceInterface
$schoolService
,
SchoolServiceInterface
$schoolService
,
StaffServiceInterface
$staffService
)
{
$this
->
schoolService
=
$schoolService
;
$this
->
staffService
=
$staffService
;
$this
->
staffService
=
$staffService
;
}
public
function
createLab
(
array
$data
)
{
$lab
=
R
::
dispense
(
'lab'
);
$required
=
[
'school_id'
,
'name'
,
'type'
,
'area'
,
'in_school_use'
,
'out_school_use'
,
'courses'
,
'attachment'
,
'has_network'
,
'has_server'
];
foreach
(
$required
as
$value
){
if
(
array_key_exists
(
$value
,
$data
)){
$lab
=
R
::
dispense
(
'lab'
);
$required
=
[
'school_id'
,
'name'
,
'type'
,
'area'
,
'in_school_use'
,
'out_school_use'
,
'courses'
,
'attachment'
,
'has_network'
,
'has_server'
,
];
foreach
(
$required
as
$value
)
{
if
(
array_key_exists
(
$value
,
$data
))
{
$lab
[
$value
]
=
$data
[
$value
];
}
else
{
}
else
{
return
-
1
;
}
}
...
...
@@ -44,27 +42,32 @@ class LabService implements LabServiceInterface
}
$id
=
R
::
store
(
$lab
);
return
$id
;
}
public
function
updateLab
(
array
$data
,
$id
){
public
function
updateLab
(
array
$data
,
$id
)
{
$lab
=
R
::
load
(
'lab'
,
$id
);
foreach
(
$data
as
$key
=>
$value
){
foreach
(
$data
as
$key
=>
$value
)
{
$lab
[
$key
]
=
$value
;
}
$id
=
R
::
store
(
$lab
);
return
$id
;
}
public
function
getLabById
(
$id
)
{
$lab
=
R
::
load
(
'lab'
,
$id
);
return
$lab
;
}
public
function
getLabsBySchoolId
(
$id
)
{
$school
=
$this
->
schoolService
->
getSchool
(
$id
);
$labs
=
$school
->
ownLab
;
$labs
=
$school
->
ownLab
;
return
$labs
;
}
}
module/schools/src/Service/SchoolService.php
View file @
29fb0a3d
...
...
@@ -17,7 +17,7 @@ class SchoolService implements SchoolServiceInterface
{
$school
=
R
::
dispense
(
'school'
);
$required
=
[
'registry_no'
,
'name'
,
'municipality'
,
'schooltype_id'
,
'prefecture_id'
,
'educationlevel_id'
,
'eduadmin_id'
,
'created'
,
'creator'
];
'educationlevel_id'
,
'eduadmin_id'
,
'created'
,
'creator'
,
];
$optional
=
[
'street_address'
,
'postal_code'
,
'phone_number'
,
'fax_number'
,
'email'
];
foreach
(
$required
as
$value
)
{
if
(
array_key_exists
(
$value
,
$data
))
{
...
...
@@ -34,11 +34,13 @@ class SchoolService implements SchoolServiceInterface
}
}
$id
=
R
::
store
(
$school
);
return
$id
;
}
public
function
getSchool
(
$id
)
{
$school
=
R
::
load
(
'school'
,
$id
);
return
$school
;
}
}
module/schools/src/Service/StaffService.php
View file @
29fb0a3d
...
...
@@ -24,8 +24,8 @@ class StaffService implements StaffServiceInterface
unset
(
$data
[
'id'
]);
$teacher
=
R
::
dispense
(
'teacher'
);
$required
=
[
'school_id'
,
'name'
,
'email'
,
'surname'
,
'telephone'
,
'position'
,
'branch
'
];
$data
[
'school_id'
]
=
1
;
'position'
,
'branch
_id'
,
];
foreach
(
$required
as
$value
)
{
if
(
array_key_exists
(
$value
,
$data
))
{
$teacher
[
$value
]
=
$data
[
$value
];
...
...
@@ -34,21 +34,25 @@ class StaffService implements StaffServiceInterface
}
}
$id
=
R
::
store
(
$teacher
);
return
$id
;
}
public
function
updateTeacher
(
array
$data
,
$id
){
public
function
updateTeacher
(
array
$data
,
$id
)
{
$teacher
=
R
::
load
(
'teacher'
,
$id
);
foreach
(
$data
as
$key
=>
$value
){
foreach
(
$data
as
$key
=>
$value
)
{
$teacher
[
$key
]
=
$value
;
}
$id
=
R
::
store
(
$teacher
);
return
$id
;
}
public
function
getTeacherById
(
$id
)
{
$teacher
=
R
::
load
(
'teacher'
,
$id
);
return
$teacher
;
}
...
...
@@ -56,6 +60,14 @@ class StaffService implements StaffServiceInterface
{
$school
=
$this
->
schoolService
->
getSchool
(
$id
);
$teachers
=
$school
->
ownTeacher
;
return
$teachers
;
}
public
function
getBranches
()
{
return
array_map
(
function
(
$branch
)
{
return
$branch
->
export
();
},
R
::
find
(
'branch'
,
'ORDER BY name ASC'
));
}
}
module/schools/src/Service/StaffServiceInterface.php
View file @
29fb0a3d
...
...
@@ -15,4 +15,5 @@ interface StaffServiceInterface
public
function
getTeacherById
(
$id
);
public
function
getTeachersBySchoolId
(
$id
);
public
function
updateTeacher
(
array
$data
,
$id
);
public
function
getBranches
();
}
module/schools/templates/schools/staff.twig
View file @
29fb0a3d
...
...
@@ -43,7 +43,7 @@
</tr>
{%
else
%}
<tr>
<td
colspan=
"
3"
class=
"text-center text-muted
"
>
<td
colspan=
"
6"
class=
"text-center text-muted no-records
"
>
Δεν έχει καταχωρηθεί προσωπικό.
</td>
</tr>
...
...
@@ -71,7 +71,7 @@
{{
macros.input
(
'surname'
,
'Επώνυμο'
,
''
,
'text'
,
{
'required'
:
''
}
)
}}
{{
macros.input
(
'telephone'
,
'Τηλέφωνο'
,
''
,
'tel'
,
{
'required'
:
''
}
)
}}
{{
macros.input
(
'email'
,
'Email'
,
''
,
'email'
,
{
'required'
:
''
}
)
}}
{{
macros.select
(
'branch'
,
'Ειδικότητα'
,
branches
,
''
,
{
'required'
:
''
}
)
}}
{{
macros.select
(
'branch
_id
'
,
'Ειδικότητα'
,
branches
,
''
,
{
'required'
:
''
}
)
}}
{{
macros.select
(
'position'
,
'Θέση'
,
positions
,
''
,
{
'multiple'
:
''
,
'required'
:
''
}
)
}}
<input
type=
"hidden"
name=
"id"
value=
""
>
</div>
...
...
public/js/schools/staff.js
View file @
29fb0a3d
...
...
@@ -57,6 +57,7 @@
evt
.
preventDefault
();
this
.
modal
.
render
(
function
(
data
)
{
that
.
model
.
add
(
data
);
that
.
$el
.
find
(
'
.no-records
'
).
remove
();
});
return
this
;
},
...
...
@@ -116,6 +117,8 @@
that
.
form
.
data
(
'
done
'
)(
response
);
that
.
form
.
data
(
'
done
'
,
undefined
);
that
.
hide
();
}).
fail
(
function
(
xhr
,
err
)
{
alert
(
xhr
.
statusText
);
});
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment