Skip to content

Commit

Permalink
Project Status Filter Added
Browse files Browse the repository at this point in the history
  • Loading branch information
swetalina-orangescrum committed May 13, 2022
1 parent 28d7196 commit b5a1d64
Show file tree
Hide file tree
Showing 7 changed files with 745 additions and 119 deletions.
53 changes: 44 additions & 9 deletions app/Controller/ProjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,28 @@ public function manage($projtype = null)
$query = "AND Project.status='3' AND Project.isactive!='2'";
$filtype = 'stack';
}
$param_count = count($_GET);
$p_type = $this->request->query['proj-type'];
$manager_id = $this->request->query['manager'];
$client = $this->request->query['client'];
$url_status = $this->request->query['fil-type'];
if ((isset($url_status)) && $url_status != 'started' && $url_status != 'on-hold' && $url_status != 'stack') {
if ($url_status == 4) {
$query .=" AND Project.status IN(". $url_status.")"." AND Project.isactive='2'";
}else{
$query .=" AND Project.status IN(". $url_status.")"." AND Project.isactive!='2'";
}
}
$this->set('inactive_project_cnt', $inactive_project_cnt);
$this->set('active_project_cnt', $active_project_cnt);
$this->set('started_project_cnt', $started_project_cnt);
$this->set('hold_project_cnt', $hold_project_cnt);
$this->set('stack_project_cnt', $stack_project_cnt);
$this->set('projtype', $projtype);
$this->set('filtype', $filtype);
$this->set('p_type', $p_type);
$this->set('manager_id', $manager_id);
$this->set('client', $client);
if ($projtype == "active-grid" || $projtype == "inactive-grid") {
$this->loadModel('ProjectField');
$fields = array();
Expand Down Expand Up @@ -753,6 +768,10 @@ public function manage($projtype = null)
if ($pjname) {
$query .= " AND name LIKE '%" . addslashes($pjname) . "%' ";
}
if (isset($p_type)){
$query.=" AND Types.id IN(".$p_type.")";

}
$sql = "SELECT SQL_CALC_FOUND_ROWS Project.id,uniq_id,name,Project.user_id,project_type,short_name,Project.description,Project.isactive,Project.status,Project.estimated_hours,Project.priority,Project.dt_created,Project.dt_updated,Project.start_date,Project.end_date,Project.project_methodology_id,Project.status_group_id,
(SELECT COUNT(easycases.id) AS tot FROM easycases WHERE easycases.project_id=Project.id and easycases.istype='1' and easycases.isactive='1') AS totalcase,
(SELECT SUM(LogTime.total_hours) AS hours
Expand All @@ -763,7 +782,8 @@ public function manage($projtype = null)
(SELECT SUM(case_files.file_size) AS file_size FROM case_files WHERE case_files.project_id=Project.id) AS storage_used,
(SELECT roles.role FROM roles,project_users where project_users.role_id = roles.id and project_users.user_id ='". SES_ID ."' and project_users.company_id = '".SES_COMP."' and project_users.project_id = Project.id group by project_users.id ) as role,
(SELECT roles.role FROM roles,company_users where company_users.role_id = roles.id and company_users.user_id ='". SES_ID ."' and company_users.company_id = '".SES_COMP."' group by company_users.id ) as crole
FROM projects AS Project
FROM projects AS Project LEFT JOIN project_metas AS ProjectMeta ON ProjectMeta.project_id = Project.id
LEFT JOIN project_types AS Types ON Types.id = ProjectMeta.proj_type
WHERE Project.name!='' " . $query . "
ORDER BY dt_created DESC $limit";

Expand Down Expand Up @@ -7986,21 +8006,36 @@ public function ajax_project_type_flt()
$this->loadModel("ProjectType");
$diy_cond = array('ProjectType.is_active' => 1);
$diy_list = $this->ProjectType->find('list', array('fields' => array('ProjectType.id', 'ProjectType.title'), 'conditions' => $diy_cond, 'order' => array('ProjectType.title' => 'ASC')));
$this->set(compact('diy_list'));

if ($this->request->data['page'] !== "manage") {
$this->set(compact('diy_list'));
}else if($this->request->data['page'] == "manage"){
$this->set('page',$this->request->data['page']);
$this->set('diy_new_list',$diy_list);
}

}
/*
* Project status filters
*/
public function ajax_project_status_flt()
{
$this->layout = 'ajax';
$diy_list = array(
'1'=>'Started',
'2'=>'Hold',
'3'=>'Stack',
'4'=>'Completed',
);
$this->set(compact('diy_list'));
if ($this->request->data['page'] !== "manage") {
$diy_list = array(
'1'=>'Started',
'2'=>'Hold',
'3'=>'Stack',
'4'=>'Completed',
);
$this->set(compact('diy_list'));
}else if($this->request->data['page'] == "manage"){
$this->loadModel("ProjectStatus");
$diy_new_list = $this->ProjectStatus->getAllProjectStatus(SES_COMP);
$this->set('page',$this->request->data['page']);
$this->set('diy_new_list',$diy_new_list);
}

}
/*
* Project client filters
Expand Down
3 changes: 2 additions & 1 deletion app/View/Elements/custom_left_menu_new.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ if(count($allLeftMenu['allUsermenus'])){
$setaClick = ($menuStatus['dynamic_a_click'])? $menuStatus['dynamic_a_click'] : $meta['a_click'];
$setMenuName = ($menuStatus['dynamic_menu_name'])? $menuStatus['dynamic_menu_name'] : $masterMenu[$menu_id]['name'];
?>
<a href="<?php echo $setUrl; ?>" onclick="<?php echo $setaClick; ?>return trackEventLeadTracker('Left Panel','<?php echo $masterMenu[$menu_id]['name'] ;?>','<?php echo $_SESSION['SES_EMAIL_USER_LOGIN'];?>');">

<a href="<?php echo $setUrl; ?>" onclick="<?php echo $setaClick; if($masterMenu[$menu_id]['name'] == "Projects"){ ?> resetProjectFilterItem(); <?php } ?> return trackEventLeadTracker('Left Panel','<?php echo $masterMenu[$menu_id]['name'] ;?>','<?php echo $_SESSION['SES_EMAIL_USER_LOGIN'];?>');">
<?php echo $masterMenu[$menu_id]['menu_icon']; ?>
<span class="mini-sidebar-label"><?php echo __($setMenuName);?></span>
<?php if($v['id'] == 57){ ?>
Expand Down
63 changes: 61 additions & 2 deletions app/View/Elements/top_bar.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<div class="wrap_top_tlbar">
<div class="row">
<div class="col-lg-12">
<div class="col-lg-8 col-sm-8">
<div class="<?php if($projtype !== 'active-grid') { ?> col-lg-6 col-sm-6 <?php } else{ ?> col-lg-8 col-sm-8 <?php } ?>">
<ul id="tour_crt_proj_swtch" class="lft_tab_tasklist fl">
<li class="all-list-glyph <?php if (($projtype == '' || $projtype == 'active-grid') && $filtype == '') { ?>active-list<?php } ?>">
<a href="javascript:void(0)" class="all-list" onclick="setDefaultProjectView('<?php echo $act_grid_view_opt; ?>');
Expand Down Expand Up @@ -156,8 +156,67 @@
<?php } ?>
</ul>
</div>
<div class="col-lg-4 col-sm-4">

<div class="col-lg-3 col-sm-3">
<div id="proj_filtered_items" class="filter_tag_items"></div>
</div>
<div class="<?php if($projtype !== 'active-grid') { ?> col-lg-3 col-sm-3 <?php } else{ ?> col-lg-4 col-sm-4 <?php } ?>">
<div id="tour_proj_view" class="fr pfl-icon-dv gidview-proj-menu">


<span class="dropdown cursor">
<a class="dropdown-toggle" data-toggle="dropdown" data-target="#" rel="tooltip" title="<?php echo __('Filter');?>">
<i class="glyphicon glyphicon-filter"></i>
</a>
<ul class="dropdown-menu case-filter-menu kanbanview-filter profitable-report-filter drop_menu_mc dropdown_menu_all_filters_ul" style="z-index:1">
<!-- <li class="drop_menu_mc">
<a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="javascript:void(0)" onclick="project_allfiltervalue('project_type');"><i class="material-icons">&#xE916;</i><?php echo __('Project Type');?></a>
<div class="dropdown_status" id="dropdown_menu_project_type_div">
<i class="status_arrow_new"></i>
<ul class="dropdown-menu" id="dropdown_menu_project_type" style="max-height: 200px;overflow-y: scroll;margin-right:160px;"></ul>
</div>
</li> -->

<li class="drop_menu_mc dropdown">
<a href="javascript:void(0)" class="dropdown-toggle" data-target="#" data-toggle="dropdown" onclick="project_allfiltervalue('project_status');"><i class="material-icons">&#xE88B;</i><?php echo __('Project Status');?></a>
<div class="dropdown_status" id="dropdown_menu_project_status_div">
<i class="status_arrow_new"></i>
<ul class="dropdown-menu" id="dropdown_menu_project_status" style="max-height: 200px;overflow-y: scroll;margin-right:160px;"></ul>
</div>
</li>
<!-- <li class="drop_menu_mc">
<a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="javascript:void(0)" onclick="project_allfiltervalue('clients');"><i class="material-icons">&#xE8F9;</i><?php echo __('Client');?></a>
<div class="dropdown_status" id="dropdown_menu_clients_div">
<i class="status_arrow_new"></i>
<ul class="dropdown-menu" id="dropdown_menu_clients" style="max-height: 200px;overflow-y: scroll;margin-right:160px;"></ul>
</div>
</li> -->
<!-- <?php if($this->Format->isAllowed('View All Resource',$roleAccess)){ ?>
<li class="drop_menu_mc dropdown">
<a href="javascript:void(0)" class="dropdown-toggle" data-target="#" data-toggle="dropdown" onclick="project_allfiltervalue('project_manager');"><i class="material-icons">&#xE90F;</i><?php echo __('Project Manager');?></a>
<div class="dropdown_status" id="dropdown_menu_project_manager_div">
<i class="status_arrow_new"></i>
<ul class="dropdown-menu" id="dropdown_menu_project_manager" style="max-height: 200px;overflow-y: scroll;margin-right:160px;"></ul>
</div>
</li>
<?php } ?> -->
<!-- <li class="drop_menu_mc dropdown">
<a href="javascript:void(0)" class="dropdown-toggle" data-target="#" data-toggle="dropdown" onclick="project_allfiltervalue('project_start_date');"><i class="material-icons">label</i><?php echo __('Project Start Date');?></a>
<div class="dropdown_status" id="dropdown_menu_project_start_date_div">
<i class="status_arrow_new"></i>
<ul class="dropdown-menu" id="dropdown_menu_project_start_date" style="max-height: 200px;overflow-y: scroll;margin-right:160px;"></ul>
</div>
</li>
<li class="drop_menu_mc dropdown">
<a href="javascript:void(0)" class="dropdown-toggle" data-target="#" data-toggle="dropdown" onclick="project_allfiltervalue('project_end_date');"><i class="material-icons">local_atm</i><?php echo __('Project End Date');?></a>
<div class="dropdown_status" id="dropdown_menu_project_end_date_div">
<i class="status_arrow_new"></i>
<ul class="dropdown-menu" id="dropdown_menu_project_end_date" style="max-height: 200px;overflow-y: scroll;margin-right:160px;"></ul>
</div>
</li> -->
</ul>
</span>

<span id="task_impExp" class="dropdown task_expPrnt case-filter-menu">
<a class="dropdown-toggle dropdown_menu_exp_print_togl pdf_export" data-toggle="dropdown" href="javascript:void(0);" data-target="#" >
<span class="export_file_icon"></span>
Expand Down
Loading

0 comments on commit b5a1d64

Please sign in to comment.