From f050a38c6bbf4d4752d16668889fc4823ba5e701 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jul 2021 01:18:28 +0200 Subject: [PATCH 1/5] Fix migration --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index eb778f521ad..b0f4d831473 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4955,7 +4955,7 @@ function migrate_export_import_profiles($mode = 'export') if ($oldfield != $newfield || $oldfilter != $newfilter) { $sqlupd = 'UPDATE '.MAIN_DB_PREFIX.$mode."_model SET field = '".$db->escape($newfield)."'"; if ($mode == 'export') { - $sql .= ", filter = '".$db->escape($newfilter)."'"; + $sqlupd .= ", filter = '".$db->escape($newfilter)."'"; } $sqlupd .= ' WHERE rowid='.$obj->rowid; $resultstring .= ''.$sqlupd."\n"; From 9d010f6d109e27dcdcb7328c9df70e531ed5a124 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jul 2021 01:24:40 +0200 Subject: [PATCH 2/5] Look and feel v14 --- htdocs/product/index.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 4aaaf3a0fa7..7069f21e459 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -105,7 +105,8 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be print ''.$langs->trans("Search").''; } print ''; - print ''; + print ''; + print ''; if ($i == 0) { print ''; } @@ -336,11 +337,11 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us $product_static->status_buy = $objp->tobuy; $product_static->status_batch = $objp->tobatch; - //Multilangs + // Multilangs if (!empty($conf->global->MAIN_MULTILANGS)) { $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql .= " WHERE fk_product=".$objp->rowid; + $sql .= " WHERE fk_product=".((int) $objp->rowid); $sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'"; $resultd = $db->query($sql); @@ -357,7 +358,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us print ''; print $product_static->getNomUrl(1, '', 16); print "\n"; - print ''.dol_trunc($objp->label, 32).''; + print ''.$objp->label.''; print ""; print dol_print_date($db->jdate($objp->datem), 'day'); print ""; @@ -372,7 +373,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us $objp->price = $price_result; } } - print ''; + print ''; if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') { print price($objp->price_ttc).' '.$langs->trans("TTC"); } else { From ff94c60cc77eb2d4947b56f8145f1f8c7845398c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jul 2021 01:45:31 +0200 Subject: [PATCH 3/5] Fix GETPOST with restricthtml --- htdocs/comm/action/index.php | 6 +++--- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9b76329d8da..af903637e6f 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -138,13 +138,13 @@ if (empty($action) && !GETPOSTISSET('action')) { if ($action == 'default') { // When action is default, we want a calendar view and not the list $action = (($defaultview != 'show_list') ? $defaultview : 'show_month'); } -if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') { +if (GETPOST('viewcal', 'int') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') { $action = 'show_month'; $day = ''; } // View by month -if (GETPOST('viewweek', 'restricthtml') || GETPOST('action', 'alpha') == 'show_week') { +if (GETPOST('viewweek', 'int') || GETPOST('action', 'alpha') == 'show_week') { $action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d")); } // View by week -if (GETPOST('viewday', 'restricthtml') || GETPOST('action', 'alpha') == 'show_day') { +if (GETPOST('viewday', 'int') || GETPOST('action', 'alpha') == 'show_day') { $action = 'show_day'; $day = ($day ? $day : date("d")); } // View by day diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 60ffa14b75d..2d560281394 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -779,7 +779,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = do { $oldstringtoclean = $out; - if (!empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') { + if (!empty($out) && !empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') { try { $dom = new DOMDocument; $dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL); From 48435eb91102eb830cde01f692f0e1bc26b9f8e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jul 2021 01:58:06 +0200 Subject: [PATCH 4/5] Fix navigation links --- htdocs/comm/action/index.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index af903637e6f..9f566f41a3e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -148,6 +148,8 @@ if (GETPOST('viewday', 'int') || GETPOST('action', 'alpha') == 'show_day') { $action = 'show_day'; $day = ($day ? $day : date("d")); } // View by day +$object = new ActionComm($db); + // Load translation files required by the page $langs->loadLangs(array('agenda', 'other', 'commercial')); @@ -197,6 +199,7 @@ if (GETPOST("viewperuser", 'alpha') || $action == 'show_peruser') { exit; } +/* if ($action == 'delete_action') { $event = new ActionComm($db); $event->fetch($actionid); @@ -206,6 +209,7 @@ if ($action == 'delete_action') { $result = $event->delete(); } +*/ /* @@ -484,25 +488,25 @@ $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoaction //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewWeek").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewDay").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); //$viewmode .= ''; From 3bc896be578b976f8b9e30d9259353b3c69b4907 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jul 2021 02:07:35 +0200 Subject: [PATCH 5/5] Debug v14 --- htdocs/comm/action/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9f566f41a3e..c87af9558e8 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -943,6 +943,7 @@ if ($showbirthday) { } } +// LEAVE CALENDAR $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = x.fk_user"; @@ -1881,7 +1882,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cacheusers[$tmpid] = $newuser; } - $listofusertoshow .= '
'.$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); + $listofusertoshow = ''; + $listofusertoshow .= '
'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); print $listofusertoshow; } else { // Other calendar // Picto