Commit 9b26136f authored by Νίκος Κατσαούνος's avatar Νίκος Κατσαούνος

fixed conflict

parents 3744336e 79467204
......@@ -78,3 +78,11 @@ deploysystem.get_school_list:
_controller: '\Drupal\deploysystem\Controller\CustomViews::getSchoolList'
requirements:
_user_is_logged_in: 'TRUE'
deploysystem.get_gelschool_list:
path: '/deploysystem/getgelschoollist/{schsearch}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\deploysystem\Controller\CustomViews::getGelSchoolList'
requirements:
_user_is_logged_in: 'TRUE'
\ No newline at end of file
......@@ -87,6 +87,37 @@ class CustomViews extends ControllerBase {
}
public function getGelSchoolList(Request $request, $schsearch) {
try {
$sCon = $this->connection->select('gel_school', 'eSchool')
->fields('eSchool', array('name', 'registry_no', 'unit_type_id', 'id'));
//->condition('eSchool.name', '%' . db_like($schsearch) . '%', 'LIKE');
$words = preg_split('/[\s]+/', $schsearch);
foreach ($words as $word)
$sCon->condition('eSchool.name', '%' . db_like($word) . '%', 'LIKE');
$schools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
//$school = reset($schools);
$list = array();
foreach ($schools as $object) {
$list[] = array(
'registry_no' => $object->registry_no,
'name' => $object->name,
'unit_type_id' => $object->unit_type_id,
'school_id' => $object->id,
);
}
return $this->respondWithStatus($list, Response::HTTP_OK);
} catch (\Exception $e) {
$this->logger->error($e->getMessage());
return $this->respondWithStatus([
'message' => t("error in getSchoolList function"),
], Response::HTTP_FORBIDDEN);
}
}
......
......@@ -476,9 +476,3 @@ epal.svc.transition-bperiod:
_controller: '\Drupal\epal\Controller\WSConsumer::transitionToBPeriod'
requirements:
_user_is_logged_in: 'TRUE'
epal.svc.test:
path: '/epal/encodeddata'
defaults:
_controller: '\Drupal\epal\Controller\CreateEncodedData::createData'
requirements:
_access: 'TRUE'
......@@ -116,7 +116,9 @@ class DirectorView extends ControllerBase
->condition('eStudent.id', $studentId , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -504,7 +506,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', -1 , '=')
->condition('eSchool.currentclass', 1 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -552,7 +554,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $sectorid , '=')
->condition('eSchool.currentclass', 2 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -595,7 +597,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $specialityid , '=')
->condition('eSchool.currentclass', 3 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -636,7 +638,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $specialityid , '=')
->condition('eSchool.currentclass', 4 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -742,7 +744,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $sectorid , '=')
->condition('eSchool.currentclass', 2 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$results = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -769,7 +771,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $specialityid , '=')
->condition('eSchool.currentclass', 3 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -795,7 +797,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $specialityid , '=')
->condition('eSchool.currentclass', 4 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -976,7 +978,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', -1 , '=')
->condition('eSchool.currentclass', 1 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -1015,7 +1017,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $sectorid , '=')
->condition('eSchool.currentclass', 2 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -1055,7 +1057,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $specialityid , '=')
->condition('eSchool.currentclass', 3 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -1091,7 +1093,7 @@ class DirectorView extends ControllerBase
->condition('eSchool.specialization_id', $specialityid , '=')
->condition('eSchool.currentclass', 4 , '=')
->condition('eStudent.delapp', 0 , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2));
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......
......@@ -134,6 +134,9 @@ class WSConsumer extends ControllerBase
$sCon->condition('gel_app.lastschool_schoolyear','2017-2018', '<');
$sCon->condition('gel_app.myschool_id',NULL, 'IS NOT');
$sCon->condition('gel_app.delapp',0, '=');
$sCon->condition('gel_app.myschool_promoted',NULL, 'IS');
$sCon->condition('gel_app.second_period',1, '=');
$students_promotions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($students_promotions as $student) {
......@@ -151,14 +154,16 @@ class WSConsumer extends ControllerBase
}
if ($result==NULL){
$this->logger->warning($count.",".$student->myschool_id.", null response");
$this->logger->warning($count.",".$student->myschool_id.", null result");
}
else{
$promotion=json_decode($result);
if ($promotion==NULL){
$this->logger->warning($count.",".$student->myschool_id.", null response");
$this->logger->warning($count.",".$student->myschool_id.", null promotion");
$promotion=0;
}
$transaction = $this->connection->startTransaction();
......@@ -194,6 +199,9 @@ class WSConsumer extends ControllerBase
$sCon->condition('epal_app.lastschool_schoolyear','2017-2018', '<');
$sCon->condition('epal_app.myschool_id',NULL, 'IS NOT');
$sCon->condition('epal_app.delapp',0, '=');
$sCon->condition('epal_app.myschool_promoted',NULL, 'IS');
$sCon->condition('epal_app.second_period',1, '=');
$students_promotions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($students_promotions as $student) {
......@@ -211,14 +219,15 @@ class WSConsumer extends ControllerBase
}
if ($result==NULL){
$this->logger->warning($count.",".$student->myschool_id.", null response");
$this->logger->warning($count.",".$student->myschool_id.", null result");
}
else{
$promotion=json_decode($result);
if ($promotion==NULL){
$this->logger->warning($count.",".$student->myschool_id.", null response");
$this->logger->warning($count.",".$student->myschool_id.", null promotion");
$promotion=0;
}
$transaction = $this->connection->startTransaction();
......
......@@ -174,3 +174,27 @@ gel.deleteFromDirector:
_controller: '\Drupal\gel\Controller\GelDistribution::deleteApplicationFromDirector'
requirements:
_user_is_logged_in: 'TRUE'
gel.sdeallstudents:
path: '/gel/sde_all_students'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\gel\Controller\SdeDistribution::getSdeStudents'
requirements:
_user_is_logged_in: 'TRUE'
gel.savehighscoolselectionforSDE:
path: '/gel/saveselectionforSDE/{studentid}/{schoolid}/{undoselection}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\gel\Controller\SdeDistribution::SaveSdeStudentHighSchhool'
requirements:
_user_is_logged_in: 'TRUE'
gel.initializationBperiod:
path: '/gel/initializationBperiod'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\gel\Controller\GelDistribution::Initializationbperiod'
requirements:
_user_is_logged_in: 'TRUE'
This diff is collapsed.
......@@ -79,6 +79,14 @@ import { IAppState } from "../../store/store";
</div>
<br>
<div class="col-md-6">
<button type="submit" class="btn btn-lg btn-block"
*ngIf="(loginInfo$ | async).size !== 0" (click)="InitializeBPeriod()" >
Initialization Β Περιόδου <span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
<br>
</div>
</div>
......@@ -95,6 +103,7 @@ import { IAppState } from "../../store/store";
private showLoader: BehaviorSubject<boolean>;
private loginInfoSub: Subscription;
private ServiceStudentCertifSub: Subscription;
private InitializedSub: Subscription;
//private wsIdentSub: Subscription;
private minedu_userName: string;
private minedu_userPassword: string;
......@@ -136,6 +145,8 @@ import { IAppState } from "../../store/store";
this.loginInfoSub.unsubscribe();
if (this.ServiceStudentCertifSub)
this.ServiceStudentCertifSub.unsubscribe();
if (this.InitializedSub)
this.InitializedSub.unsubscribe();
//if (this.wsIdentSub)
// this.wsIdentSub.unsubscribe();
}
......@@ -239,7 +250,52 @@ import { IAppState } from "../../store/store";
}
InitializeBPeriod()
{
console.log("ua mas trelanei");
this.showLoader.next(true);
this.InitializedSub = this._hds.InitialazationBPeriod(this.minedu_userName, this.minedu_userPassword)
.subscribe(data => {
let mTitle = "ok";
let mText = "H αρχικοποιηση για τη Β' περίοδο έγινε με επιτυχία.";
let mHeader = "modal-header-success";
this.modalTitle.next(mTitle);
this.modalText.next(mText);
this.modalHeader.next(mHeader);
this.showModal("#promotionNotice");
(<any>$(".loading")).remove();
this.showLoader.next(false);
},
error => {
console.log("Error Getting goToSecondPeriod from Web Service");
let mTitle = "Αποτυχία Αρχικοποιησης.";
let mText = "Αποτυχία Αρχικοποιησης. " +
"Προσπαθήστε ξανά. Σε περίπτωση που το πρόβλημα επιμείνει, παρακαλώ επικοινωνήστε με την ομάδα υποστήριξης.";
let mHeader = "modal-header-danger";
this.modalTitle.next(mTitle);
this.modalText.next(mText);
this.modalHeader.next(mHeader);
this.showModal("#promotionNotice");
(<any>$(".loading")).remove();
this.showLoader.next(false);
return;
});
}
}
//}
}
......@@ -1836,6 +1836,25 @@ Initialazation() {
}
InitialazationBPeriod(username, userpassword) {
let headers = new Headers({
"Content-Type": "application/json",
});
this.createMinistryAuthorizationHeader(headers, username, userpassword);
let options = new RequestOptions({ headers: headers });
console.log("tralalala");
return this.http.get(`${AppSettings.API_ENDPOINT}/gel/initializationBperiod` , options)
.map(response => response.json());
}
findIfInitialized()
{
this.loginInfo$.getValue().forEach(loginInfoToken => {
......@@ -1892,4 +1911,39 @@ deleteApplicationforDirectorGel(appId) {
}
getAllSDEStudents() {
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role;
});
let headers = new Headers({
"Content-Type": "application/json",
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/gel/sde_all_students` , options)
.map(response => response.json());
}
saveHighScoolSelectionforSDE(studentid, schoolid, undosel){
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role;
});
let headers = new Headers({
"Content-Type": "application/json",
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
//if (oldschool == false)
//{
// oldschool = 999999;
//}
return this.http.get(`${AppSettings.API_ENDPOINT}/gel/saveselectionforSDE/`+ studentid + '/'+schoolid + '/' + undosel, options)
.map(response => response.json());
}
}
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