From 2b64af0d34d9310701b25c9ea37df01d8612859c Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Mon, 13 Sep 2021 16:17:34 -0500 Subject: [PATCH 1/5] Add a condition in the view 'print all assigned' from locations where it skips the assets in relation of if they're archived and that option is marked in the settings --- resources/views/locations/print.blade.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/views/locations/print.blade.php b/resources/views/locations/print.blade.php index 97fc15d958..3cc565fe03 100644 --- a/resources/views/locations/print.blade.php +++ b/resources/views/locations/print.blade.php @@ -122,11 +122,15 @@ @php - $counter = 1; + $counter = 1;; @endphp @foreach ($assets as $asset) - + @php + if($snipeSettings->show_archived_in_list != 1 && $asset->assetstatus->name === 'Archived'){ + continue; + } + @endphp {{ $counter }} {{ $asset->asset_tag }} From 1b433920f12b0aba636c9915c83e02a738a669d7 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Mon, 13 Sep 2021 16:24:12 -0500 Subject: [PATCH 2/5] Delete an extra semicolon --- resources/views/locations/print.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/locations/print.blade.php b/resources/views/locations/print.blade.php index 3cc565fe03..634f43aa4c 100644 --- a/resources/views/locations/print.blade.php +++ b/resources/views/locations/print.blade.php @@ -122,7 +122,7 @@ @php - $counter = 1;; + $counter = 1; @endphp @foreach ($assets as $asset) From 1ae665b6455ab72633fd2e2a72a55e3881e2bcf4 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Mon, 13 Sep 2021 16:45:05 -0500 Subject: [PATCH 3/5] Use the property 'archived' so if the 'name' one changes it doesn't fails --- resources/views/locations/print.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/locations/print.blade.php b/resources/views/locations/print.blade.php index 634f43aa4c..981c52e575 100644 --- a/resources/views/locations/print.blade.php +++ b/resources/views/locations/print.blade.php @@ -127,7 +127,7 @@ @foreach ($assets as $asset) @php - if($snipeSettings->show_archived_in_list != 1 && $asset->assetstatus->name === 'Archived'){ + if($snipeSettings->show_archived_in_list != 1 && $asset->assetstatus->archived == 1){ continue; } @endphp From 37fe4e91b194e5fc7020815302d58b5071ff2e13 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 13 Sep 2021 15:24:30 -0700 Subject: [PATCH 4/5] Upgrade Docker to PHP 7.4 --- Dockerfile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 86e6b81419..2acac57289 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM ubuntu:bionic -LABEL maintainer Brady Wetherington +FROM ubuntu:focal +LABEL maintainer Brady Wetherington # No need to add `apt-get clean` here, reference: # - https://github.com/snipe/snipe-it/pull/9201 @@ -14,15 +14,15 @@ RUN export DEBIAN_FRONTEND=noninteractive; \ apt-utils \ apache2 \ apache2-bin \ -libapache2-mod-php7.2 \ -php7.2-curl \ -php7.2-ldap \ -php7.2-mysql \ -php7.2-gd \ -php7.2-xml \ -php7.2-mbstring \ -php7.2-zip \ -php7.2-bcmath \ +libapache2-mod-php7.4 \ +php7.4-curl \ +php7.4-ldap \ +php7.4-mysql \ +php7.4-gd \ +php7.4-xml \ +php7.4-mbstring \ +php7.4-zip \ +php7.4-bcmath \ patch \ curl \ wget \ @@ -38,7 +38,7 @@ autoconf \ libc-dev \ pkg-config \ libmcrypt-dev \ -php7.2-dev \ +php7.4-dev \ ca-certificates \ unzip \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -47,16 +47,16 @@ unzip \ RUN curl -L -O https://github.com/pear/pearweb_phars/raw/master/go-pear.phar RUN php go-pear.phar -RUN pecl install mcrypt-1.0.2 +RUN pecl install mcrypt-1.0.3 -RUN bash -c "echo extension=/usr/lib/php/20170718/mcrypt.so > /etc/php/7.2/mods-available/mcrypt.ini" +RUN bash -c "echo extension=/usr/lib/php/20190902/mcrypt.so > /etc/php/7.4/mods-available/mcrypt.ini" RUN phpenmod mcrypt RUN phpenmod gd RUN phpenmod bcmath -RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/7.2/apache2/php.ini -RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/7.2/cli/php.ini +RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/7.4/apache2/php.ini +RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/7.4/cli/php.ini RUN useradd -m --uid 1000 --gid 50 docker From c6b26965a0d85a837430a9ac985d18e285958828 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 13 Sep 2021 15:47:13 -0700 Subject: [PATCH 5/5] Check for valid category name Signed-off-by: snipe --- resources/views/users/print.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php index ae6c2406cc..8ecf450f3c 100644 --- a/resources/views/users/print.blade.php +++ b/resources/views/users/print.blade.php @@ -231,7 +231,7 @@ {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} @endif - {{ $consumable->category->name }} + {{ ($consumable->category) ? $consumable->category->name : ' invalid/deleted category' }} {{ $consumable->assetlog->first()->created_at }} @php