Skip to content

Commit

Permalink
Fixed migration ci_session
Browse files Browse the repository at this point in the history
  • Loading branch information
maximeor committed Jan 11, 2022
1 parent 5d370b1 commit 7657243
Show file tree
Hide file tree
Showing 20 changed files with 85 additions and 32 deletions.
2 changes: 1 addition & 1 deletion app/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function display_view($view_parts, $data = NULL)
foreach (config('Common\Config\AdminPanelConfig')->tabs as $tab){
if (strstr(current_url(), $tab['pageLink'])) {
$data['title'] = lang($tab['title']);
echo view('\Common\Adminmenu');
echo view('\Common\adminMenu');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function up() {
$this->forge->addKey('id', true, true);
$this->forge->addForeignKey('fk_trainer', 'user','id');
$this->forge->addForeignKey('fk_acquisition_status', 'acquisition_status','id');
$this->forge->createTable('Comment');
$this->forge->createTable('comment');

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,19 @@ public function up() {
'name' => [
'type' => 'varchar',
'constraint' => '150',
'default' => 'null',
],
'symbol' => [
'type' => 'varchar',
'constraint' => '10',
],
'methodologic' => [
'type' => 'text',
'default' => 'null',
],
'social' => [
'type' => 'text',
'default' => 'null',
],
'personal' => [
'type' => 'text',
'default' => 'null',
],

'archive timestamp null',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion orif/plafor/Views/acquisition_status/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<p class="bg-primary text-white"><?=lang('plafor_lang.field_linked_comments')?></p>
</div>
<?php if($_SESSION['user_access'] >= config('\User\Config\UserConfig')->access_lvl_trainer) { ?>
<a href="<?= base_url('plafor/apprentice/add_comment/'.$acquisition_status['id']); ?>" class="btn btn-primary"><?= lang('plafor_lang.title_comment_new'); ?></a>
<a style="margin-left: 15px" href="<?= base_url('plafor/apprentice/add_comment/'.$acquisition_status['id']); ?>" class="btn btn-primary"><?= lang('plafor_lang.title_comment_new'); ?></a>
<?php } ?>
<div class="col-md-12">
<table class="table table-hover">
Expand Down
6 changes: 3 additions & 3 deletions orif/plafor/Views/apprentice/list.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
view('\Plafor\templates\navigator',['reset'=>true]);
helper('Form');
helper('form');
/**
* Users List View
*
Expand All @@ -16,7 +16,7 @@
<div style="display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap: wrap">
<?php
echo form_open(base_url('plafor/apprentice/list_apprentice/'), ['method' => 'GET']);
echo form_dropdown('trainer_id', $trainers, strval($trainer_id), ['class' => 'form-control', 'style' => 'width:unset!important;display:unset!important;margin-left:-10px;']);
echo form_dropdown('trainer_id', $trainers, strval($trainer_id), ['class' => 'form-control', 'style' => 'width:unset!important;display:unset!important;']);
echo form_submit(null, lang('common_lang.btn_search'), ['class' => 'btn btn-primary', 'style' => 'vertical-align:unset!important;']); ?>
<?php
echo form_close();
Expand Down Expand Up @@ -69,7 +69,7 @@
<script type="text/babel" defer>

$(document).ready(function () {
initProgress("<?=base_url("plafor/apprentice/getcourseplanprogress")?>"+'/',"<?=lang('plafor_lang.details_progress')?>");
setTimeout(()=>{initProgress("<?=base_url("plafor/apprentice/getcourseplanprogress")?>"+'/',"<?=lang('plafor_lang.details_progress')?>")},200);
$('#toggle_deleted').change(e => {
let checked = e.currentTarget.checked;
$.post('<?php echo base_url("plafor/apprentice/list_apprentice") . '/'?>' + ((checked == true ? '1' : '0')), {}, data => {
Expand Down
14 changes: 7 additions & 7 deletions orif/plafor/Views/apprentice/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
<table class="table table-hover table-borderless user-course-details-table">
<tbody>
<tr>
<td class="user-course-details-begin-date"><?=$userCourseMax['date_begin']?></td>
<td class="user-course-details-end-date"><?=$userCourseMax['date_end']?></td>
<td class="user-course-details-status"><?=$user_course_status[$userCourseMax['fk_status']]['name']?></td>
<td class="user-course-details-begin-date"><?=isset($userCourseMax)?$userCourseMax['date_begin']:null?></td>
<td class="user-course-details-end-date"><?=isset($userCourseMax)?$userCourseMax['date_end']:null?></td>
<td class="user-course-details-status"><?=isset($userCourseMax)?$user_course_status[$userCourseMax['fk_status']]['name']:null?></td>

</tr>
</tbody>
Expand All @@ -98,16 +98,16 @@
<div class="row mt-2">
<div class="col-md-12">
<p class="bg-primary text-white"><?=lang('plafor_lang.title_course_plan_status')?></p>
<p class="font-weight-bold user-course-details-course-plan-name"><?= $course_plans[$userCourseMax['fk_course_plan']]['official_name'] ?></p>
<div id="detailsArray" apprentice_id="<?= $apprentice['id'] ?>" course_plan_id="<?=$userCourseMax['fk_course_plan']?>"></div>
<p class="font-weight-bold user-course-details-course-plan-name"><?= isset($userCourseMax)?$course_plans[$userCourseMax['fk_course_plan']]['official_name']:null ?></p>
<div id="detailsArray" apprentice_id="<?= $apprentice['id'] ?>" course_plan_id="<?=isset($userCourseMax)?$userCourseMax['fk_course_plan']:null?>"></div>
</div>
</div>
</div>

<script type="text/babel">
$(document).ready(()=>{
$('#usercourseSelector').val(<?=$userCourseMax['id']?>);
displayDetails(null,<?=json_encode($userCourseMax)?>,'integrated',"<?=base_url("plafor/apprentice/getcourseplanprogress")?>"+'/',"<?=base_url('plafor/apprentice/view_user_course')?>");
$('#usercourseSelector').val(<?=isset($userCourseMax)?$userCourseMax['id']:null?>);
setTimeout(()=>{displayDetails(null,<?=json_encode($userCourseMax)?>,'integrated',"<?=base_url("plafor/apprentice/getcourseplanprogress")?>"+'/',"<?=base_url('plafor/apprentice/view_user_course')?>");},200)
$('#usercourseSelector').change((event)=>{
let userCourses=<?= json_encode($user_courses)?>;
let coursePlans=<?= json_encode($course_plans)?>;
Expand Down
16 changes: 8 additions & 8 deletions orif/plafor/Views/course_plan/list.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
view('\Plafor\templates\navigator',['reset'=>true]);
helper('Form');
helper('form');
/**
* Users List View
*
Expand All @@ -16,17 +16,17 @@
</div>
</div>
<div class="row" style="justify-content:space-between">
<div class="col-sm-3 text-left">
<div class="col-sm-3">
<a href="<?= base_url('plafor/courseplan/save_course_plan'); ?>" class="btn btn-primary">
<?= lang('common_lang.btn_new_m'); ?>
</a>
</div>
<div style="align-self:flex-end;">
<?=form_checkbox('toggle_deleted', '', $with_archived, [
'id' => 'toggle_deleted', 'class' => 'form-check-input'
]);?>
<?=form_label(lang('common_lang.btn_show_disabled'), 'toggle_deleted', ['class' => 'form-check-label']);?>
</div>
<div style="margin-left: 20px; width:100%; padding: 0 15px 0 15px">
<?=form_checkbox('toggle_deleted', '', $with_archived, [
'id' => 'toggle_deleted', 'class' => 'form-check-input'
]);?>
<?=form_label(lang('common_lang.btn_show_disabled'), 'toggle_deleted', ['class' => 'form-check-label']);?>
</div>
</div>
<div class="row mt-2">
<div class="col-sm-3 offset-6">
Expand Down
65 changes: 61 additions & 4 deletions orif/plafor/Views/operational_competence/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<?php if (service('session')->get('user_access')>=config('\User\Config\UserConfig')->access_lvl_admin): ?>
<a href="<?=base_url('plafor/courseplan/save_objective/0/'.$operational_competence['id']) ?>" class="btn btn-primary"><?= lang('common_lang.btn_new_m')?></a>
<?php endif;?>
<table class="table table-hover">
<table class="responsiveTable table table-hover">
<thead>
<tr>
<th><span class="font-weight-bold"><?=lang('plafor_lang.field_objectives_symbols')?></span></th>
Expand All @@ -81,8 +81,15 @@
if (isset($objectives)):
foreach ($objectives as $objective){
?><tr>
<td><a class="font-weight-bold" href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['symbol']?></a></td>
<td><a href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['taxonomy']?></a></td>
<td>
<a class="font-weight-bold" href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['symbol']?></a>

</td>
<td>
<span class="font-weight-bold descTitle" style="display: none"><?=lang('plafor_lang.field_taxonomy')?></span>
<a href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['taxonomy']?></a>

</td>
<td><a href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['name']?></a></td>
<?php if(service('session')->get('user_access')>=config('\User\Config\UserConfig')->access_lvl_admin):?>
<td><a href="<?= base_url('plafor/courseplan/save_objective/'.$objective['id'].'/'.$operational_competence['id']); ?>"><?= lang('common_lang.btn_edit')?></a></td>
Expand All @@ -95,4 +102,54 @@
</table>
</div>
</div>
</div>
</div>
<script defer type="text/javascript">
window.addEventListener('resize',()=>{

if (window.innerWidth<490){

if (document.querySelectorAll('.responsiveTable td:nth-child(2) .descTitle').item(0)!==null?window.getComputedStyle(document.querySelectorAll('.responsiveTable td:nth-child(2) .descTitle').item(0)).display!=="none":false)
document.querySelectorAll('.responsiveTable td:nth-child(2)').forEach((element)=>{
let tax=document.createElement('span');
tax.innerHTML=`<span class='taxonomyResponsive'>${element.innerHTML}<span>`

element.previousElementSibling.appendChild(tax);
element.remove();

})
}
else{
document.querySelectorAll('.responsiveTable td:nth-child(1) .taxonomyResponsive').forEach((element)=>{
let td=document.createElement('td');
td.innerHTML=element.innerHTML;
if (element.parentElement.parentElement.nextElementSibling.querySelector('.descTitle')==null)
element.parentElement.parentElement.after(td);
element.remove();
})
}

});
if (window.innerWidth<490){

if (document.querySelectorAll('.responsiveTable td:nth-child(2) .descTitle').item(0)!==null?window.getComputedStyle(document.querySelectorAll('.responsiveTable td:nth-child(2) .descTitle').item(0)).display!=="none":false)
document.querySelectorAll('.responsiveTable td:nth-child(2)').forEach((element)=>{
let tax=document.createElement('span');
tax.innerHTML=`<span class='taxonomyResponsive'>${element.innerHTML}<span>`

element.previousElementSibling.appendChild(tax);
element.remove();

})
}
else{
document.querySelectorAll('.responsiveTable td:nth-child(1) .taxonomyResponsive').forEach((element)=>{
let td=document.createElement('td');
td.innerHTML=element.innerHTML;
if (element.parentElement.parentElement.nextElementSibling.querySelector('.descTitle')==null)
element.parentElement.parentElement.after(td);
element.remove();
})
}


</script>
2 changes: 1 addition & 1 deletion orif/plafor/Views/templates/navigator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<?php echo count($navigatorLink)>1 && $i!=count($navigatorLink)-1 ? '<span class="text-primary"><i class="bi bi-arrow-right-short" ></i></span>' : ''?>
<?php } ?>
<?php else : ?>
<a id="navigator-back" class="btn btn-outline-primary mr-2 bi bi-arrow-left-circle" href="<?= base_url("courseplan/list_course_plan") ?>">
<a id="navigator-back" class="btn btn-outline-primary mr-2 bi bi-arrow-left-circle" href="<?= base_url("plafor/courseplan/list_course_plan") ?>">
<?= lang("common_lang.btn_back") ?>
</a>
<?php endif;?>
Expand Down
4 changes: 2 additions & 2 deletions orif/plafor/Views/user_course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
|| ($_SESSION['user_access'] == config('\User\Config\UserConfig')->access_lvl_trainer && in_array($_SESSION['user_id'], $trainers_id))
|| ($_SESSION['user_access'] == config('\User\Config\UserConfig')->access_level_apprentice && $user_course['fk_user'] == $apprentice['id'])): ?>
<div class="row">
<p class="font-weight-bold"><?= lang('plafor_lang.field_user_course_objectives_status') ?></p>
<div class="col-md-12">
<p style="margin-left: 15px" class="font-weight-bold"><?= lang('plafor_lang.field_user_course_objectives_status') ?></p>
<div class="col-md-12" >
<table class="table table-hover" id="objectiveListContent">
<thead>
<tr>
Expand Down

0 comments on commit 7657243

Please sign in to comment.