Skip to content

Commit

Permalink
replace some fa icons
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 committed Jan 19, 2025
1 parent 2f33ab8 commit 84edce1
Show file tree
Hide file tree
Showing 46 changed files with 245 additions and 304 deletions.
4 changes: 4 additions & 0 deletions css/includes/components/_utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@
.d-flex-soft {
display: flex;
}

.fs-2x {
font-size: 2em !important;
}
28 changes: 4 additions & 24 deletions src/Change.php
Original file line number Diff line number Diff line change
Expand Up @@ -1037,26 +1037,6 @@ public static function getItemLinkClass(): string
return Change_Item::class;
}

public static function getStatusClass($status)
{
$class = null;
$solid = true;

switch ($status) {
case self::REFUSED:
case self::CANCELED:
$class = 'circle';
break;
default:
return parent::getStatusClass($status);
}

return $class == null
? ''
: 'itilstatus ' . ($solid ? 'fas fa-' : 'far fa-') . $class .
" " . static::getStatusKey($status);
}

public static function getStatusKey($status)
{
switch ($status) {
Expand Down Expand Up @@ -1333,11 +1313,11 @@ public static function showCentralList($start, $status = "process", $showgroupch
) {
foreach ($change->users[CommonITILActor::REQUESTER] as $d) {
if ($d["users_id"] > 0) {
$name = '<i class="fas fa-sm fa-fw fa-user text-muted me-1"></i>' .
$name = '<i class="fs-4 ti ti-user text-muted me-1"></i>' .
htmlescape(getUserName($d["users_id"]));
$requesters[] = $name;
} else {
$requesters[] = '<i class="fas fa-sm fa-fw fa-envelope text-muted me-1"></i>' .
$requesters[] = '<i class="fs-4 ti ti-mail text-muted me-1"></i>' .
$d['alternative_email'];
}
}
Expand All @@ -1348,7 +1328,7 @@ public static function showCentralList($start, $status = "process", $showgroupch
&& count($change->groups[CommonITILActor::REQUESTER])
) {
foreach ($change->groups[CommonITILActor::REQUESTER] as $d) {
$requesters[] = '<i class="fas fa-sm fa-fw fa-users text-muted me-1"></i>' .
$requesters[] = '<i class="fs-4 ti ti-users text-muted me-1"></i>' .
Dropdown::getDropdownName("glpi_groups", $d["groups_id"]);
}
}
Expand Down Expand Up @@ -1515,7 +1495,7 @@ public static function showCentralCount(bool $foruser = false, bool $display = t
$twig_params['items'][] = [
'link' => $CFG_GLPI["root_doc"] . "/front/change.php?" . Toolbox::append_params($options),
'text' => __('Deleted'),
'icon' => 'fas fa-trash bg-red-lt',
'icon' => 'ti ti-trash bg-red-lt',
'count' => $number_deleted
];

Expand Down
76 changes: 16 additions & 60 deletions src/CommonITILObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -4105,10 +4105,10 @@ public function getSpecificMassiveActions($checkitem = null)
|| Session::haveRight(Problem::$rightname, UPDATE);
if ($can_update_itilobject) {
$actions['CommonITILObject_CommonITILObject' . MassiveAction::CLASS_ACTION_SEPARATOR . 'add']
= "<i class='fa-fw fas fa-link'></i>" .
= "<i class='ti ti-link'></i>" .
_sx('button', 'Link ITIL Object');
$actions['CommonITILObject_CommonITILObject' . MassiveAction::CLASS_ACTION_SEPARATOR . 'delete']
= "<i class='fa-fw fas fa-link'></i>" .
= "<i class='ti ti-unlink'></i>" .
_sx('button', 'Unlink ITIL Object');
}
}
Expand Down Expand Up @@ -5134,64 +5134,20 @@ public static function getStatusIcon($status)
*/
public static function getStatusClass($status)
{
$class = null;
$solid = true;

switch ($status) {
case self::INCOMING:
$class = 'circle';
break;
case self::ASSIGNED:
$class = 'circle';
$solid = false;
break;
case self::PLANNED:
$class = 'calendar';
$solid = false;
break;
case self::WAITING:
$class = 'circle';
break;
case self::SOLVED:
$class = 'circle';
$solid = false;
break;
case self::CLOSED:
$class = 'circle';
break;
case self::ACCEPTED:
$class = 'check-circle';
break;
case self::OBSERVED:
$class = 'eye';
break;
case self::EVALUATION:
$class = 'circle';
$solid = false;
break;
case self::APPROVAL:
$class = 'question-circle';
break;
case self::TEST:
$class = 'question-circle';
break;
case self::QUALIFICATION:
$class = 'circle';
$solid = false;
break;
case Change::REFUSED:
$class = 'times-circle';
$solid = false;
break;
case Change::CANCELED:
$class = 'ban';
break;
}
$class = match ($status) {
self::INCOMING, self::WAITING, self::CLOSED => 'circle-filled',
self::ASSIGNED, self::SOLVED, self::EVALUATION => 'circle',
self::PLANNED => 'calendar',
self::ACCEPTED => 'check-circle-filled',
self::OBSERVED => 'eye',
self::APPROVAL, self::TEST => 'help',
self::QUALIFICATION => 'circle',
Change::REFUSED => 'circle-x',
Change::CANCELED => 'ban',
default => null
};

return $class === null
? ''
: 'itilstatus ' . ($solid ? 'fas fa-' : 'far fa-') . $class .
" " . static::getStatusKey($status);
return $class === null ? '' : 'itilstatus ti ti-' . $class . " " . static::getStatusKey($status);
}

/**
Expand Down Expand Up @@ -7877,7 +7833,7 @@ class_exists($validation_class) && $params['with_validations']
if (strlen($log_row['field']) > 0) {
$content = sprintf(__s("%s: %s"), htmlescape($log_row['field']), $content);
}
$content = "<i class='fas fa-history me-1' title='" . __s("Log entry") . "' data-bs-toggle='tooltip'></i>" . $content;
$content = "<i class='ti ti-history me-1' title='" . __s("Log entry") . "' data-bs-toggle='tooltip'></i>" . $content;
$user_id = 0;
// try to extract ID from "user_name" (which was created using User::getNameForLog)
if (preg_match('/ \((\d+)\)$/', $log_row["user_name"], $m)) {
Expand Down
8 changes: 4 additions & 4 deletions src/CommonITILValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,13 +657,13 @@ public static function getStatus($value, bool $decorated = false)
$classes = null;
switch ($value) {
case self::WAITING:
$classes = 'waiting far fa-clock';
$classes = 'waiting ti ti-clock';
break;
case self::ACCEPTED:
$classes = 'accepted fas fa-check';
$classes = 'accepted ti ti-check';
break;
case self::REFUSED:
$classes = 'refused fas fa-times';
$classes = 'refused ti ti-x';
break;
}

Expand Down Expand Up @@ -1055,7 +1055,7 @@ public function showSummary(CommonDBTM $item)
]);

$script = <<<HTML
<span class="far fa-edit" style="cursor:pointer" title="{$edit_title}"
<span class="ti ti-edit" style="cursor:pointer" title="{$edit_title}"
onclick="viewEditValidation{$item_id}{$row_id}{$rand}();"
id="viewvalidation{$view_validation_id}{$row_id}{$rand}">
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/Dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,7 @@ public static function showOutputFormat($itemtype = null)
Dropdown::showFromArray('display_type', $values, ['rand' => $rand]);
echo "<button type='submit' name='export' class='btn' " .
" title=\"" . _sx('button', 'Export') . "\">" .
"<i class='far fa-save'></i><span class='sr-only'>" . _sx('button', 'Export') . "<span>";
"<i class='ti ti-device-floppy'></i><span class='sr-only'>" . _sx('button', 'Export') . "<span>";
}


Expand Down
4 changes: 2 additions & 2 deletions src/Glpi/Dashboard/FakeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public static function nbTicketsByAgreementStatusAndTechnician(array $params = [
],
'labels' => self::getFakeNames(),
],
'icon' => 'fas fa-stopwatch',
'icon' => 'ti ti-stopwatch',
];
}

Expand Down Expand Up @@ -274,7 +274,7 @@ public static function nbTicketsByAgreementStatusAndTechnicianGroup(array $param
_x('fake_data', 'Helpdesk team'),
],
],
'icon' => 'fas fa-stopwatch',
'icon' => 'ti ti-stopwatch',
];
}

Expand Down
16 changes: 8 additions & 8 deletions src/Glpi/Dashboard/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function show(bool $mini = false, ?string $token = null)

if (!self::$embed) {
if (!$mini && $can_create) {
$l_tb_icons .= "<i class='btn btn-sm btn-icon btn-ghost-secondary fas fa-plus fs-toggle add-dashboard' title='$add_dash_label'></i>";
$l_tb_icons .= "<i class='btn btn-sm btn-icon btn-ghost-secondary ti ti-plus fs-toggle add-dashboard' title='$add_dash_label'></i>";
}
if (!$mini && $can_clone) {
$r_tb_icons .= "<i class='btn btn-sm btn-icon btn-ghost-secondary ti ti-copy fs-toggle clone-dashboard' title='$clone_label'></i>";
Expand Down Expand Up @@ -388,15 +388,15 @@ public function show(bool $mini = false, ?string $token = null)
<div class='filters_toolbar m-2 {{ is_placeholder ? "d-none" : "" }}'>
<span class='filters'></span>
<span class='filters-control'>
<i class="btn btn-sm btn-ghost-secondary fas fa-plus plus-sign add-filter">
<i class="btn btn-sm btn-ghost-secondary ti ti-plus plus-sign add-filter">
<span class='add-filter-lbl'>{{ messages['add_filter'] }}</span>
</i>
</span>
</div>
<div class='placeholder_info {{ is_placeholder ? "" : "d-none" }}' style="background-color: transparent; color: var(--tblr-body-color); font-size: var(--tblr-body-font-size)">
<div class="alert alert-info">
<div class="d-flex">
<i class="ti ti-info-circle fa-2x me-3"></i>
<i class="ti ti-info-circle fs-2x me-3"></i>
<div>
<h4 class="alert-title">{{ messages['placeholder_main'] }}</h4>
<div class="mt-2">
Expand Down Expand Up @@ -701,7 +701,7 @@ public function displayAddDashboardForm()
echo "</div>"; // .field

echo Html::submit(_x('button', "Add"), [
'icon' => 'fas fa-plus',
'icon' => 'ti ti-plus',
'class' => 'btn btn-primary submit-new-dashboard'
]);

Expand Down Expand Up @@ -819,7 +819,7 @@ public function displayFilterForm(array $params = [])
echo "</div>"; // .field

echo Html::submit(_x('button', "Add"), [
'icon' => 'fas fa-plus',
'icon' => 'ti ti-plus',
'class' => 'btn btn-primary mt-2'
]);
echo "</form>"; // form.card.display-filter-form
Expand Down Expand Up @@ -910,7 +910,7 @@ public function displayEditRightsForm()
echo "</div>";

echo "<a href='#' class='btn btn-primary save_rights'>
<i class='far fa-save'></i>
<i class='ti ti-device-floppy'></i>
<span>" . __("Save") . "</span>
</a>";

Expand Down Expand Up @@ -942,11 +942,11 @@ public function getCardHtml(string $card_id = "", array $card_options = []): str

// retrieve card
$notfound_html = "<div class='empty-card card-warning '>
<i class='fas fa-exclamation-triangle'></i>" .
<i class='ti ti-alert-triangle'></i>" .
__('empty card!') . "
</div>";
$render_error_html = "<div class='empty-card card-error '>
<i class='fas fa-exclamation-triangle'></i>" .
<i class='ti ti-alert-triangle'></i>" .
__('Error rendering card!') .
"</br>" .
$card_id .
Expand Down
10 changes: 5 additions & 5 deletions src/Glpi/Dashboard/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public static function nbTicketsGeneric(
break;

case 'late':
$params['icon'] = "far fa-clock";
$params['icon'] = "ti ti-clock";
$params['label'] = __("Late tickets");
$search_criteria = [
$notold,
Expand Down Expand Up @@ -385,7 +385,7 @@ public static function nbTicketsGeneric(
case 'assigned':
if (!$skip) {
$status = Ticket::ASSIGNED;
$params['icon'] = "fas fa-users";
$params['icon'] = "ti ti-users";
$params['label'] = __("Assigned tickets");
$skip = true;
}
Expand Down Expand Up @@ -470,7 +470,7 @@ public static function nbTicketsByAgreementStatusAndTechnician(array $params = [

$default_params = [
'label' => "",
'icon' => 'fas fa-stopwatch',
'icon' => 'ti ti-stopwatch',
'apply_filters' => [],
];
$params = array_merge($default_params, $params);
Expand Down Expand Up @@ -639,7 +639,7 @@ public static function nbTicketsByAgreementStatusAndTechnicianGroup(

$default_params = [
'label' => "",
'icon' => 'fas fa-stopwatch',
'icon' => 'ti ti-stopwatch',
'apply_filters' => [],
];
$params = array_merge($default_params, $params);
Expand Down Expand Up @@ -1571,7 +1571,7 @@ public static function averageTicketTimes(array $params = [])
$DBread = DBConnection::getReadConnection();
$default_params = [
'label' => "",
'icon' => "fas fa-stopwatch",
'icon' => "ti ti-stopwatch",
'apply_filters' => [],
];
$params = array_merge($default_params, $params);
Expand Down
Loading

0 comments on commit 84edce1

Please sign in to comment.