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": {
"type": "-",
"size": 9777,
"lmtime": 0,
"size": 9521,
"lmtime": 1764104901603,
"modified": false
},
"class.Site.php": {
@@ -101,8 +101,8 @@
},
"class.Tasks.php": {
"type": "-",
"size": 16529,
"lmtime": 1745269305993,
"size": 18207,
"lmtime": 1764203726003,
"modified": false
},
"class.Users.php": {
@@ -146,13 +146,13 @@
"class.Projects.php": {
"type": "-",
"size": 27334,
"lmtime": 1745261880238,
"lmtime": 1764203265163,
"modified": false
},
"class.Tasks.php": {
"type": "-",
"size": 20898,
"lmtime": 1745876411486,
"size": 21638,
"lmtime": 1764203740414,
"modified": false
},
"class.Users.php": {
@@ -204,19 +204,31 @@
"style.css": {
"type": "-",
"size": 22678,
<<<<<<< HEAD
"lmtime": 1764150215841,
=======
"lmtime": 1764183540355,
>>>>>>> adab4009ea3d5c884248109e64208485f9841267
"modified": false
},
"style.css.map": {
"type": "-",
"size": 40575,
<<<<<<< HEAD
"lmtime": 1764150215841,
=======
"lmtime": 1764183540367,
>>>>>>> adab4009ea3d5c884248109e64208485f9841267
"modified": false
},
"style.scss": {
"type": "-",
"size": 28194,
<<<<<<< HEAD
"lmtime": 1764150215424,
=======
"lmtime": 1764183540380,
>>>>>>> adab4009ea3d5c884248109e64208485f9841267
"modified": false
}
},
@@ -416,7 +428,62 @@
"cron": {},
"finances": {},
"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": {
"layout-cron.php": {
"type": "-",
@@ -452,8 +519,8 @@
},
"main_view.php": {
"type": "-",
"size": 32125,
"lmtime": 1754600819046,
"size": 34861,
"lmtime": 1764203691866,
"modified": false
},
"task_edit.php": {
@@ -464,8 +531,8 @@
},
"task_popup.php": {
"type": "-",
"size": 6272,
"lmtime": 1743622901914,
"size": 7349,
"lmtime": 1764108641205,
"modified": false
},
"task_single.php": {

View File

@@ -300,7 +300,7 @@ class Tasks
'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>' .
'<p>' . $task['text'] . '</p>' .
'<p>' . html_entity_decode( $task['text'] ) . '</p>' .
'<p>Pozdrawiamy<br/>Zespół crmPRO.pl</p>'
);
}
@@ -533,4 +533,15 @@ class Tasks
echo json_encode( $response );
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 '
. 'LEFT JOIN task_user AS tu ON tu.task_id = t.id '
. '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'
) -> fetchAll( \PDO::FETCH_ASSOC );
$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 $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()
{

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;
&.zoom-100 {
font-size: 130%;
font-size: 1.2em;
}
&.zoom-90 {
font-size: 120%;
font-size: 1.15em;
}
&.zoom-80 {
font-size: 110%;
font-size: 1.1em;
}
&.zoom-70 {
font-size: 100%;
font-size: 1.05em;
}
&.zoom-60 {
font-size: 95%;
font-size: 1em;
}
&.zoom-50 {
font-size: 85%;
font-size: 0.95em;
}
&.zoom-40 {
font-size: 80%;
font-size: 0.9em;
}
&.zoom-30 {
font-size: 75%;
font-size: 0.85em;
}
&.zoom-20 {
font-size: 75%;
font-size: 0.8em;
}
&.zoom-10 {
font-size: 70%;
font-size: 0.75em;
}
&.zoom-0 {
font-size: 70%;
font-size: 0.7em;
}
}
}

View File

@@ -3,7 +3,7 @@
<select name="filtr" class="form-control">
<option value="">--- wybierz filtr ---</option>
<? 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;?>
</select>
<div class="_buttons">
@@ -832,50 +832,68 @@
e.preventDefault();
isProgrammaticUpdate = true;
var projects = $( this ).find( 'option:selected' ).attr( 'projects' );
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);
var filtr_id = $(this).val();
const usersArr = String(users || '')
.split(',')
.map(s => s.trim())
.filter(Boolean);
// Pobierz dane filtra przez AJAX
$.ajax({
type: 'POST',
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
const $projectInputs = $('.tasks_main_view input[name="projects"].g-checkbox');
const $userInputs = $('.tasks_main_view input[name="users"].g-checkbox');
if (data.status == 'success') {
var projects = data.projects || '';
var users = data.users || '';
// najpierw czyścimy wszystkie
$projectInputs.each(function() {
$(this).iCheck('uncheck');
});
$userInputs.each(function() {
$(this).iCheck('uncheck');
});
// parsowanie wejść (string "1,2,3" -> ['1','2','3'])
const projectsArr = String(projects)
.split(',')
.map(s => s.trim())
.filter(Boolean);
// ustawiamy zaznaczenia
$projectInputs.each(function () {
const val = String($(this).val()).trim();
if (projectsArr.includes(val)) {
$(this).iCheck('check');
const usersArr = String(users)
.split(',')
.map(s => s.trim())
.filter(Boolean);
// 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) {