From 0f5dc90bae34e6c6e3250254767fcc9b3bda9486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Bautista=20Mesa=20Rold=C3=A1n?= Date: Sat, 24 Jun 2017 16:45:45 +0200 Subject: [PATCH 1/2] Fixing pages warning when value is null --- htdocs/accountancy/admin/accountmodel.php | 2 +- htdocs/accountancy/admin/categories_list.php | 2 +- htdocs/accountancy/admin/journals_list.php | 2 +- htdocs/adherents/document.php | 2 +- htdocs/adherents/subscription/list.php | 2 +- htdocs/admin/dict.php | 2 +- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/tools/listsessions.php | 2 +- htdocs/admin/websites.php | 2 +- htdocs/comm/action/listactions.php | 2 +- htdocs/comm/action/rapport/index.php | 2 +- htdocs/compta/prelevement/ligne.php | 2 +- htdocs/fourn/facture/list.php | 2 +- htdocs/fourn/facture/paiement.php | 2 +- htdocs/societe/notify/index.php | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index ff908d6d066..a29cce64749 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -68,7 +68,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index e71482b0efa..cb852d82e0c 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -74,7 +74,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 3dc932dbab5..dca29fd28b8 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -58,7 +58,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index dd22a74577d..65dbadb11a6 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -52,7 +52,7 @@ $result=restrictedArea($user,'adherent',$id); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 628ceb390e3..369c56b068c 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -46,7 +46,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 6db098f0750..485c5713636 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -73,7 +73,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 123877f7f4e..16277811b72 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -67,7 +67,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 56db6eb2ad7..c57a78974ed 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -47,7 +47,7 @@ $langs->load("other"); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/admin/websites.php b/htdocs/admin/websites.php index 1dc91786ada..4dbd154096f 100644 --- a/htdocs/admin/websites.php +++ b/htdocs/admin/websites.php @@ -54,7 +54,7 @@ $status = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 01094a78164..35fccdef2c8 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -80,7 +80,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; if (! $sortorder) { diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index e83506d8206..dcda4e0cf04 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -42,7 +42,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="a.datep"; diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 933c23b0e7e..20ac3d18082 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -251,7 +251,7 @@ if ($id) - if ($page == -1) { $page = 0 ; } + if ($page == -1 || $page == null) { $page = 0 ; } $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index a9e372a9709..056a1961b4c 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -109,7 +109,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 59b6e2a27e9..fcf7dc92ebf 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -601,7 +601,7 @@ if (empty($action)) $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); - if ($page == -1) { $page = 0 ; } + if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php index ebebb23494c..4b7a5a3a111 100644 --- a/htdocs/societe/notify/index.php +++ b/htdocs/societe/notify/index.php @@ -42,7 +42,7 @@ if ($sortfield == "") $sortfield="s.nom"; } -if ($page == -1) { $page = 0 ; } +if ($page == -1 || $page == null) { $page = 0 ; } $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; From 03cb850442c27558a0ba2f737e877a5bbe3b113f Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 24 Jun 2017 20:48:11 +0200 Subject: [PATCH 2/2] $forceimgscaleheight instead $forceimgscalewidth --- .../core/modules/printsheet/doc/pdf_standardlabel.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 5fce4c63a51..6411e97c423 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -61,11 +61,11 @@ class pdf_standardlabel extends CommonStickerGenerator */ function Add_PDF_label(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$photo='') { - global $mysoc,$conf,$langs; - global $forceimgscalewidth,$forceimgscaleheight; + global $mysoc, $conf, $langs; + global $forceimgscalewidth, $forceimgscaleheight; $imgscalewidth=(empty($forceimgscalewidth)?0.3:$forceimgscalewidth); // Scale of image for width (1=Full width of sticker) - $imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker) + $imgscaleheight=(empty($forceimgscaleheight)?0.5:$forceimgscaleheight); // Scale of image for height (1=Full height of sticker) // We are in a new page, then we must add a page if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) {