This commit is contained in:
2025-12-17 14:00:31 +01:00
8 changed files with 166 additions and 65 deletions

View File

@@ -89,8 +89,8 @@
}, },
"class.Projects.php": { "class.Projects.php": {
"type": "-", "type": "-",
"size": 9777, "size": 9521,
"lmtime": 0, "lmtime": 1764104901603,
"modified": false "modified": false
}, },
"class.Site.php": { "class.Site.php": {
@@ -101,8 +101,8 @@
}, },
"class.Tasks.php": { "class.Tasks.php": {
"type": "-", "type": "-",
"size": 16529, "size": 18207,
"lmtime": 1745269305993, "lmtime": 1764203726003,
"modified": false "modified": false
}, },
"class.Users.php": { "class.Users.php": {
@@ -146,13 +146,13 @@
"class.Projects.php": { "class.Projects.php": {
"type": "-", "type": "-",
"size": 27334, "size": 27334,
"lmtime": 1745261880238, "lmtime": 1764203265163,
"modified": false "modified": false
}, },
"class.Tasks.php": { "class.Tasks.php": {
"type": "-", "type": "-",
"size": 20898, "size": 21638,
"lmtime": 1745876411486, "lmtime": 1764203740414,
"modified": false "modified": false
}, },
"class.Users.php": { "class.Users.php": {
@@ -204,19 +204,31 @@
"style.css": { "style.css": {
"type": "-", "type": "-",
"size": 22678, "size": 22678,
<<<<<<< HEAD
"lmtime": 1764150215841, "lmtime": 1764150215841,
=======
"lmtime": 1764183540355,
>>>>>>> adab4009ea3d5c884248109e64208485f9841267
"modified": false "modified": false
}, },
"style.css.map": { "style.css.map": {
"type": "-", "type": "-",
"size": 40575, "size": 40575,
<<<<<<< HEAD
"lmtime": 1764150215841, "lmtime": 1764150215841,
=======
"lmtime": 1764183540367,
>>>>>>> adab4009ea3d5c884248109e64208485f9841267
"modified": false "modified": false
}, },
"style.scss": { "style.scss": {
"type": "-", "type": "-",
"size": 28194, "size": 28194,
<<<<<<< HEAD
"lmtime": 1764150215424, "lmtime": 1764150215424,
=======
"lmtime": 1764183540380,
>>>>>>> adab4009ea3d5c884248109e64208485f9841267
"modified": false "modified": false
} }
}, },
@@ -416,7 +428,62 @@
"cron": {}, "cron": {},
"finances": {}, "finances": {},
"html": {}, "html": {},
"projects": {}, "projects": {
"closed-tasks.php": {
"type": "-",
"size": 5365,
"lmtime": 0,
"modified": false
},
"inprogress-tasks.php": {
"type": "-",
"size": 6860,
"lmtime": 0,
"modified": false
},
"main_view.php": {
"type": "-",
"size": 2500,
"lmtime": 0,
"modified": false
},
"project_edit.php": {
"type": "-",
"size": 2429,
"lmtime": 0,
"modified": false
},
"task-details.php": {
"type": "-",
"size": 5602,
"lmtime": 0,
"modified": false
},
"task-edit.php": {
"type": "-",
"size": 7707,
"lmtime": 0,
"modified": false
},
"tasks.php": {
"type": "-",
"size": 27718,
"lmtime": 1764104901602,
"modified": false
},
"toreview-tasks.php": {
"type": "-",
"size": 6399,
"lmtime": 0,
"modified": false
},
"unassigned-tasks.php": {
"type": "-",
"size": 6002,
"lmtime": 0,
"modified": false
}
},
"site": { "site": {
"layout-cron.php": { "layout-cron.php": {
"type": "-", "type": "-",
@@ -452,8 +519,8 @@
}, },
"main_view.php": { "main_view.php": {
"type": "-", "type": "-",
"size": 32125, "size": 34861,
"lmtime": 1754600819046, "lmtime": 1764203691866,
"modified": false "modified": false
}, },
"task_edit.php": { "task_edit.php": {
@@ -464,8 +531,8 @@
}, },
"task_popup.php": { "task_popup.php": {
"type": "-", "type": "-",
"size": 6272, "size": 7349,
"lmtime": 1743622901914, "lmtime": 1764108641205,
"modified": false "modified": false
}, },
"task_single.php": { "task_single.php": {

View File

@@ -300,7 +300,7 @@ class Tasks
'biuro@project-pro.pl', 'biuro@project-pro.pl',
'crmPRO - zmieniono status zadania', '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>' . '<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>' .
'<p>' . $task['text'] . '</p>' . '<p>' . html_entity_decode( $task['text'] ) . '</p>' .
'<p>Pozdrawiamy<br/>Zespół crmPRO.pl</p>' '<p>Pozdrawiamy<br/>Zespół crmPRO.pl</p>'
); );
} }
@@ -533,4 +533,15 @@ class Tasks
echo json_encode( $response ); echo json_encode( $response );
exit; exit;
} }
static function filtr_get() {
$filtr = \factory\Tasks::filtr_details( \S::get( 'filtr_id' ) );
echo json_encode( [
'status' => 'success',
'projects' => $filtr['projects'],
'users' => $filtr['users']
] );
exit;
}
} }

View File

@@ -385,7 +385,7 @@ class Projects
. 'tasks AS t ' . 'tasks AS t '
. 'LEFT JOIN task_user AS tu ON tu.task_id = t.id ' . 'LEFT JOIN task_user AS tu ON tu.task_id = t.id '
. 'WHERE ' . 'WHERE '
. '( user_id = ' . (int)$user_id . ' OR created_by = ' . (int)$user_id . ' ) AND project_id = ' . $row['id'] . ' AND ( status = 0 OR status = 1 ) AND deleted = 0 AND ( date_complete IS NULL OR date_complete > \'' . date( 'Y-m-d', strtotime( "-21 days") ) . '\' ) ' . '( user_id = ' . (int)$user_id . ' OR created_by = ' . (int)$user_id . ' ) AND project_id = ' . $row['id'] . ' AND ( status = 0 OR status = 5 ) AND deleted = 0 AND ( date_complete IS NULL OR date_complete > \'' . date( 'Y-m-d', strtotime( "-21 days") ) . '\' ) '
. 'GROUP BY t.id' . 'GROUP BY t.id'
) -> fetchAll( \PDO::FETCH_ASSOC ); ) -> fetchAll( \PDO::FETCH_ASSOC );
$row['total_tasks'] = count( $count ); $row['total_tasks'] = count( $count );

View File

@@ -6,6 +6,11 @@ class Tasks
public static $statuses = [ 0 => 'nowe', 3 => 'do rozliczenia', 5 => 'do zrobienia', 1 => 'do sprawdzenia', 2 => 'zamknięte' ]; public static $statuses = [ 0 => 'nowe', 3 => 'do rozliczenia', 5 => 'do zrobienia', 1 => 'do sprawdzenia', 2 => 'zamknięte' ];
public static $priorities = [ 0 => 'niski', 1 => 'normalny', 2 => 'wysoki', 3 => 'pilny' ]; public static $priorities = [ 0 => 'niski', 1 => 'normalny', 2 => 'wysoki', 3 => 'pilny' ];
static public function filtr_details( $filtr_id ) {
global $mdb;
return $mdb -> get( 'tasks_filtrs', '*', [ 'id' => $filtr_id ] );
}
static public function get_priorities() static public function get_priorities()
{ {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1327,47 +1327,47 @@ body>.top {
color: $cBlack; color: $cBlack;
&.zoom-100 { &.zoom-100 {
font-size: 130%; font-size: 1.2em;
} }
&.zoom-90 { &.zoom-90 {
font-size: 120%; font-size: 1.15em;
} }
&.zoom-80 { &.zoom-80 {
font-size: 110%; font-size: 1.1em;
} }
&.zoom-70 { &.zoom-70 {
font-size: 100%; font-size: 1.05em;
} }
&.zoom-60 { &.zoom-60 {
font-size: 95%; font-size: 1em;
} }
&.zoom-50 { &.zoom-50 {
font-size: 85%; font-size: 0.95em;
} }
&.zoom-40 { &.zoom-40 {
font-size: 80%; font-size: 0.9em;
} }
&.zoom-30 { &.zoom-30 {
font-size: 75%; font-size: 0.85em;
} }
&.zoom-20 { &.zoom-20 {
font-size: 75%; font-size: 0.8em;
} }
&.zoom-10 { &.zoom-10 {
font-size: 70%; font-size: 0.75em;
} }
&.zoom-0 { &.zoom-0 {
font-size: 70%; font-size: 0.7em;
} }
} }
} }

View File

@@ -3,7 +3,7 @@
<select name="filtr" class="form-control"> <select name="filtr" class="form-control">
<option value="">--- wybierz filtr ---</option> <option value="">--- wybierz filtr ---</option>
<? foreach ( $this -> tasks_filtrs as $filtr ):?> <? foreach ( $this -> tasks_filtrs as $filtr ):?>
<option value="<?= $filtr[ 'id' ];?>" projects="<?= $filtr['projects'];?>" users="<?= $filtr['users'];?>"><?= $filtr[ 'name' ];?></option> <option value="<?= $filtr[ 'id' ];?>"><?= $filtr[ 'name' ];?></option>
<? endforeach;?> <? endforeach;?>
</select> </select>
<div class="_buttons"> <div class="_buttons">
@@ -832,50 +832,68 @@
e.preventDefault(); e.preventDefault();
isProgrammaticUpdate = true; isProgrammaticUpdate = true;
var projects = $( this ).find( 'option:selected' ).attr( 'projects' ); var filtr_id = $(this).val();
var users = $( this ).find( 'option:selected' ).attr( 'users' );
// parsowanie wejść (string "1,2,3" -> ['1','2','3'])
const projectsArr = String(projects || '')
.split(',')
.map(s => s.trim())
.filter(Boolean);
const usersArr = String(users || '') // Pobierz dane filtra przez AJAX
.split(',') $.ajax({
.map(s => s.trim()) type: 'POST',
.filter(Boolean); cache: false,
url: '/tasks/filtr_get/',
data: {
filtr_id: filtr_id
},
success: function(response) {
var data = jQuery.parseJSON(response);
// Selektor dla checkboxów w filtrze if (data.status == 'success') {
const $projectInputs = $('.tasks_main_view input[name="projects"].g-checkbox'); var projects = data.projects || '';
const $userInputs = $('.tasks_main_view input[name="users"].g-checkbox'); var users = data.users || '';
// najpierw czyścimy wszystkie // parsowanie wejść (string "1,2,3" -> ['1','2','3'])
$projectInputs.each(function() { const projectsArr = String(projects)
$(this).iCheck('uncheck'); .split(',')
}); .map(s => s.trim())
$userInputs.each(function() { .filter(Boolean);
$(this).iCheck('uncheck');
});
// ustawiamy zaznaczenia const usersArr = String(users)
$projectInputs.each(function () { .split(',')
const val = String($(this).val()).trim(); .map(s => s.trim())
if (projectsArr.includes(val)) { .filter(Boolean);
$(this).iCheck('check');
// Selektor dla checkboxów w filtrze
const $projectInputs = $('.tasks_main_view input[name="projects"].g-checkbox');
const $userInputs = $('.tasks_main_view input[name="users"].g-checkbox');
// najpierw czyścimy wszystkie
$projectInputs.each(function() {
$(this).iCheck('uncheck');
});
$userInputs.each(function() {
$(this).iCheck('uncheck');
});
// ustawiamy zaznaczenia
$projectInputs.each(function () {
const val = String($(this).val()).trim();
if (projectsArr.includes(val)) {
$(this).iCheck('check');
}
});
$userInputs.each(function () {
const val = String($(this).val()).trim();
if (usersArr.includes(val)) {
$(this).iCheck('check');
}
});
isProgrammaticUpdate = false;
// wywołuj z tablicami, nie ze stringami
reload_tasks(projectsArr, usersArr);
}
} }
}); });
$userInputs.each(function () {
const val = String($(this).val()).trim();
if (usersArr.includes(val)) {
$(this).iCheck('check');
}
});
isProgrammaticUpdate = false;
// wywołuj z tablicami, nie ze stringami
reload_tasks(projectsArr, usersArr);
}); });
$( 'body' ).on( 'click', '.task_popup .task-delete', function(e) { $( 'body' ).on( 'click', '.task_popup .task-delete', function(e) {