Zaktualizuj logikę wyświetlania zadań do przeglądu i zadań zbiorczych, popraw ustawienia e-mail oraz dostosuj style w widoku zadań

This commit is contained in:
2025-02-20 19:26:42 +01:00
parent c10650e888
commit 7769790e84
8 changed files with 109 additions and 26 deletions

View File

@@ -89,20 +89,20 @@
},
"class.Site.php": {
"type": "-",
"size": 593,
"lmtime": 0,
"size": 575,
"lmtime": 1739949672039,
"modified": false
},
"class.Tasks.php": {
"type": "-",
"size": 14373,
"lmtime": 1739910394588,
"lmtime": 1739949703870,
"modified": false
},
"class.Users.php": {
"type": "-",
"size": 3357,
"lmtime": 1739908495902,
"size": 3591,
"lmtime": 1739949406414,
"modified": false
},
"class.Wiki.php": {
@@ -145,8 +145,8 @@
},
"class.Users.php": {
"type": "-",
"size": 1984,
"lmtime": 1734256814274,
"size": 2020,
"lmtime": 1739949821014,
"modified": false
},
"class.Wiki.php": {
@@ -156,7 +156,32 @@
"modified": false
}
},
"view": {}
"view": {
"class.Cron.php": {
"type": "-",
"size": 164,
"lmtime": 0,
"modified": false
},
"class.Projects.php": {
"type": "-",
"size": 46,
"lmtime": 0,
"modified": false
},
"class.Site.php": {
"type": "-",
"size": 1014,
"lmtime": 1739949954506,
"modified": false
},
"class.Users.php": {
"type": "-",
"size": 361,
"lmtime": 0,
"modified": false
}
}
},
"ceidg.php": {
"type": "-",
@@ -184,8 +209,8 @@
},
"index.php": {
"type": "-",
"size": 2345,
"lmtime": 0,
"size": 2347,
"lmtime": 1739949544224,
"modified": false
},
"layout": {
@@ -383,7 +408,7 @@
"layout-logged.php": {
"type": "-",
"size": 5371,
"lmtime": 1739908447871,
"lmtime": 1739949165285,
"modified": false
},
"layout-unlogged.php": {

View File

@@ -104,13 +104,44 @@ class Tasks
exit;
}
if ( \S::get( 'tasks_bulk' ) == 'hide' )
{
\S::set_session( 'tasks_bulk', 'hide' );
header( 'Location: /tasks/main_view/' );
exit;
}
if ( \S::get( 'tasks_bulk' ) == 'show' )
{
\S::del_session( 'tasks_bulk' );
header( 'Location: /tasks/main_view/' );
exit;
}
// tasks_to_review
if ( \S::get( 'tasks_to_review' ) == 'hide' )
{
\S::set_session( 'tasks_to_review', 'hide' );
header( 'Location: /tasks/main_view/' );
exit;
}
if ( \S::get( 'tasks_to_review' ) == 'show' )
{
\S::del_session( 'tasks_to_review' );
header( 'Location: /tasks/main_view/' );
exit;
}
$show_tasks_closed = \S::get_session( 'tasks_closed' );
$show_tasks_bulk = \S::get_session( 'tasks_bulk' );
$show_tasks_to_review = \S::get_session( 'tasks_to_review' );
return \Tpl::view( 'tasks/main_view', [
'tasks_new' => \factory\Tasks::get_tasks( 0, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ),
'tasks_to_review' => \factory\Tasks::get_tasks( 1, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ),
'tasks_to_review' => $show_tasks_to_review == 'hide' ? null : \factory\Tasks::get_tasks( 1, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ),
'tasks_closed' => $show_tasks_closed == 'hide' ? null : \factory\Tasks::get_tasks( 2, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ), // zakończone
'tasks_bulk' => \factory\Tasks::get_tasks( 3, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ), // opłaty
'tasks_bulk' => $show_tasks_bulk == 'hide' ? null : \factory\Tasks::get_tasks( 3, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ), // opłaty
'tasks_suspended' => \factory\Tasks::get_tasks( 4, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ), // projektowe
'tasks_to_do' => \factory\Tasks::get_tasks( 5, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ), // do zrobienia
'tasks_fvat' => \factory\Tasks::get_tasks( 6, $user['id'], \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ), // faktury
@@ -122,6 +153,8 @@ class Tasks
'selected_users' => \S::get_session( 'selected_users' ),
'tasks_filtrs' => \factory\Tasks::get_filtrs( $user['id'] ),
'show_tasks_closed' => $show_tasks_closed,
'show_tasks_bulk' => $show_tasks_bulk,
'show_tasks_to_review' => $show_tasks_to_review,
'users' => \factory\Users::users_list(),
] );
}
@@ -241,12 +274,13 @@ class Tasks
$statuses = \factory\Tasks::get_statuses();
if ( $task['status_change_mail'] )
if ( $task['status_change_mail'] ) {
\S::send_email(
'jacek.pyziak@project-pro.pl',
'biuro@project-pro.pl',
'crmPRO - zmieniono status zadania',
'<p>Witaj<br/>zmieniono status zadania <b>' . $task['name'] . ' - ' . \factory\Crm::get_client_name( (int)$task['client_id'] ) . '</b> na <b>' . $statuses[ $task['status'] ] . '</b>.</p>'
);
}
}
static public function task_change_status()
@@ -255,7 +289,7 @@ class Tasks
if ( $mdb -> update( 'tasks', [ 'status' => \S::get( 'status' ) ], [ 'id' => \S::get( 'task_id' ) ] ) )
{
if ( \S::get( 'status' ) == 1 or \S::get( 'status' ) == 2 )
if ( \S::get( 'status' ) == 3 or \S::get( 'status' ) == 1 )
{
self::send_email_task_change_status( \S::get( 'task_id' ) );
}

View File

@@ -4,7 +4,7 @@ $database['host'] = 'localhost';
$database['user'] = 'admin_crmpro';
$database['password'] = '3RGQ3gauxUQdvZsksyQv';
$settings['email_host'] = 'mail.project-pro.pl';
$settings['email_port'] = 587;
$settings['email_login'] = 'www@project-pro.pl';
$settings['email_host'] = 'mail.projectpro.pl';
$settings['email_port'] = 25;
$settings['email_login'] = 'www@projectpro.pl';
$settings['email_password'] = 'ProjectPro2025!';

View File

@@ -50,7 +50,7 @@ $mdb = new medoo([
$domain = preg_replace( '#^(http(s)?://)?w{3}\.#', '$1', $_SERVER['SERVER_NAME'] );
$cookie_name = str_replace( '.', '-', $domain );
$settings = \factory\Crm::settings();
$settings = array_merge( $settings, \factory\Crm::settings());
if ( isset( $_COOKIE[$cookie_name] ) && !isset( $_SESSION['user'] ) )
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -421,8 +421,12 @@ body>.top {
}
._timer {
display: flex;
gap: 5px;
.recursively {
color: #ccc;
color: #FFF;
background: #405189;
border-radius: 3px;
cursor: pointer;
margin-bottom: 5px;
@@ -432,7 +436,7 @@ body>.top {
display: block;
i {
font-size: 15px;
font-size: 12px;
}
}

View File

@@ -107,7 +107,7 @@
</ul>
</div>
<div class="column tasks_to_review">
<h2>Zadania do sprawdzenia</h2>
<h2>Zadania do sprawdzenia <? if ( $this -> show_tasks_to_review == 'hide' ):?><i class="fa fa-eye" title="Pokaż zadania do sprawdzenia"></i><? else:?><i class="fa fa-times" title="Ukryj zadania do sprawdzenia"></i><? endif;?></h2>
<ul>
<? foreach ( $this -> tasks_to_review as $task ):?>
<?
@@ -122,7 +122,7 @@
</ul>
</div>
<div class="column tasks_bulk">
<h2>Do rozliczenia</h2>
<h2>Do rozliczenia <? if ( $this -> show_tasks_bulk == 'hide' ):?><i class="fa fa-eye" title="Pokaż zadania do rozliczenia"></i><? else:?><i class="fa fa-times" title="Ukryj zadania do rozliczenia"></i><? endif;?></h2>
<ul>
<? foreach ( $this -> tasks_bulk as $task ):?>
<?
@@ -768,6 +768,26 @@
document.location.href = '/tasks/main_view/tasks_closed=show';
});
$( 'body' ).on( 'click', '.tasks_bulk i.fa-eye', function(e) {
e.preventDefault();
document.location.href = '/tasks/main_view/tasks_bulk=show';
});
$( 'body' ).on( 'click', '.tasks_bulk i.fa-times', function(e) {
e.preventDefault();
document.location.href = '/tasks/main_view/tasks_bulk=hide';
});
$( 'body' ).on( 'click', '.tasks_to_review i.fa-eye', function(e) {
e.preventDefault();
document.location.href = '/tasks/main_view/tasks_to_review=show';
});
$( 'body' ).on( 'click', '.tasks_to_review i.fa-times', function(e) {
e.preventDefault();
document.location.href = '/tasks/main_view/tasks_to_review=hide';
});
$( 'body' ).on( 'change', '.task_work_date_start', function()
{
var date_start = $( this ).val();