From 0f574579eb71e95969d6dd2b645162016f0c8f1b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 7 Mar 2018 12:27:13 +0100 Subject: [PATCH 01/13] Fix: avoid error if type is not numeric --- htdocs/categories/class/categorie.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 46063c0f8c4..a8018e2c104 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1201,6 +1201,8 @@ class Categorie extends CommonObject */ function get_all_categories($type=null, $parent=false) { + if (! is_numeric($type)) $type = $this->MAP_ID[$type]; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " WHERE entity IN (".getEntity('category').")"; if (! is_null($type)) From a0774d523d234e83ef7fb26b3100ae94275c852d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 7 Mar 2018 15:24:23 +0100 Subject: [PATCH 02/13] Fix: avoid conflict between invoice and invoicenumber sharings --- htdocs/core/lib/functions2.lib.php | 11 +++++++---- htdocs/core/modules/facture/mod_facture_mars.php | 4 ++-- htdocs/core/modules/facture/mod_facture_terre.php | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 3cbef60f5fd..49a2f12db03 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -715,9 +715,12 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m global $conf,$user; if (! is_object($objsoc)) $valueforccc=$objsoc; - else if($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=$objsoc->code_fournisseur; + else if ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=$objsoc->code_fournisseur; else $valueforccc=$objsoc->code_client; + $sharetable = $table; + if ($table == 'facture' || $table == 'invoice') $sharetable = 'invoicenumber'; // for getEntity function + // Clean parameters if ($date == '') $date=dol_now(); // We use local year and month of PHP server to search numbers // but we should use local year and month of user @@ -979,7 +982,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '(PROV%)'"; if ($bentityon) // only if entity enable - $sql.= " AND entity IN (".getEntity($table, 1).")"; + $sql.= " AND entity IN (".getEntity($sharetable).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; @@ -1027,7 +1030,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; if ($bentityon) // only if entity enable - $sql.= " AND entity IN (".getEntity($table, 1).")"; + $sql.= " AND entity IN (".getEntity($sharetable).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; @@ -1081,7 +1084,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m //$sql.= " WHERE ".$field." not like '(%'"; $maskrefclient_sql.= " WHERE ".$field." LIKE '".$maskrefclient_maskLike."'"; if ($bentityon) // only if entity enable - $maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")"; + $maskrefclient_sql.= " AND entity IN (".getEntity($sharetable).")"; if ($where) $maskrefclient_sql.=$where; //use the same optional where as general mask if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask $maskrefclient_sql.=' AND (SUBSTRING('.$field.', '.(strpos($maskwithnocode,$maskrefclient)+1).', '.dol_strlen($maskrefclient_maskclientcode).")='".$maskrefclient_clientcode."')"; diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 85dff1aa0e1..831dce5d3e4 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -153,7 +153,7 @@ class mod_facture_mars extends ModeleNumRefFactures $sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE facnumber LIKE '".$prefix."____-%'"; - $sql.= " AND entity IN (".getEntity('facture').")"; + $sql.= " AND entity IN (".getEntity('invoicenumber').")"; $resql=$db->query($sql); dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); @@ -177,7 +177,7 @@ class mod_facture_mars extends ModeleNumRefFactures $sql = "SELECT facnumber as ref"; $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'"; - $sql.= " AND entity IN (".getEntity('facture').")"; + $sql.= " AND entity IN (".getEntity('invoicenumber').")"; dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 4c27340f270..174d8314784 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -169,7 +169,7 @@ class mod_facture_terre extends ModeleNumRefFactures $sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE facnumber LIKE '".$prefix."____-%'"; - $sql.= " AND entity IN (".getEntity('facture').")"; + $sql.= " AND entity IN (".getEntity('invoicenumber').")"; $resql=$db->query($sql); dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); @@ -193,7 +193,7 @@ class mod_facture_terre extends ModeleNumRefFactures $sql = "SELECT facnumber as ref"; $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'"; - $sql.= " AND entity IN (".getEntity('facture').")"; + $sql.= " AND entity IN (".getEntity('invoicenumber').")"; dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); From b2f6105ae251221a1c291ace826e8f5bca521a1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 15:52:58 +0100 Subject: [PATCH 03/13] FIX #8277 --- htdocs/core/actions_sendmails.inc.php | 1 - htdocs/societe/card.php | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index eea69e37c13..8a29a268e68 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -319,7 +319,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $filename = $attachedfiles['names']; $mimetype = $attachedfiles['mimes']; - // Feature to push mail sent into Sent folder if (! empty($conf->dolimail->enabled)) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 217a5367ecf..bfe7db71aca 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -790,8 +790,10 @@ if (empty($reshook)) $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); } - // Actions to send emails $id=$socid; + $object->fetch($socid); + + // Actions to send emails $trigger_name='COMPANY_SENTBYMAIL'; $paramname='socid'; $mode='emailfromthirdparty'; From f4f009d877dfcda54b5ba6ce9870f72698acf4f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 16:10:40 +0100 Subject: [PATCH 04/13] FIX #8269 --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 5b1148cd885..99a50e08af8 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2928,7 +2928,7 @@ else } // Presend form - $modelmail='supplier_order_send'; + $modelmail='order_supplier_send'; $defaulttopic='SendBillRef'; $diroutput = $conf->fournisseur->facture->dir_output; $trackid = 'sin'.$object->id; From acc29ea1639ac0daa4f31f98822422e8b97abc8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 16:19:13 +0100 Subject: [PATCH 05/13] FIX #8219 --- htdocs/fourn/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 8d10d55b3bd..817eb99d8f7 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -587,7 +587,7 @@ if ($object->id > 0) print ''; print ''; print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("LastSupplierOrders",($num<$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' '.$num.''.$langs->trans("AllOrders").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; print ''; From 884b74a6bb322a44e129ea54cf77e4399ad54536 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 7 Mar 2018 17:12:59 +0100 Subject: [PATCH 06/13] FIX: warning when adding ECM files using old photo path --- htdocs/core/class/html.formfile.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a48ae7477fc..d84357c3559 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1018,7 +1018,17 @@ class FormFile // Get list of files stored into database for same relative directory if ($relativedir) { - $filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC); + $filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC); + + if($modulepart == 'produit' && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && ! empty($object->id)) { + if (! empty($conf->product->enabled)) $upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos"; + else $upload_dirold = $conf->service->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos"; + + $relativedirold = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dirold); + $relativedirold = preg_replace('/^[\\/]/','',$relativedirold); + + $filearrayindatabase = array_merge($filearrayindatabase, dol_dir_list_in_database($relativedirold, '', null, 'name', SORT_ASC)); + } //var_dump($filearray); //var_dump($filearrayindatabase); From c02e8e9831d6920132356b3c06bce20439f05019 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 19:13:15 +0100 Subject: [PATCH 07/13] Css --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7fffee21b05..7cb2236524a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1226,7 +1226,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi $tabsname=str_replace("@", "", $picto); $out.='
'; - $out.=''.$langs->trans("More").'... ('.$nbintab.')'; + $out.=''.$langs->trans("More").'... ('.$nbintab.')'; $out.='
'; $out.=$outmore; $out.='
'; @@ -3733,7 +3733,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', } if (dol_strlen($morehtmlright)) { - $return.= ''.$morehtmlright.''; + $return.= ''.$morehtmlright.''; } $return.= ''."\n"; From 69ef6a9316363895c8708b4fe2d0529daa823cbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 18:32:25 +0100 Subject: [PATCH 08/13] Fix data on thirdparty tooltip --- htdocs/compta/paiement/card.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 6179fb9ac22..3a6727b4299 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -338,15 +338,18 @@ if ($resql) { $objp = $db->fetch_object($resql); - print ''; + $thirdpartystatic->fetch($objp->socid); - $invoice=new Facture($db); - $invoice->fetch($objp->facid); - $paiement = $invoice->getSommePaiement(); - $creditnotes=$invoice->getSumCreditNotesUsed(); - $deposits=$invoice->getSumDepositsUsed(); - $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); - $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); + $invoice=new Facture($db); + $invoice->fetch($objp->facid); + + $paiement = $invoice->getSommePaiement(); + $creditnotes=$invoice->getSumCreditNotesUsed(); + $deposits=$invoice->getSumDepositsUsed(); + $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); + $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); + + print ''; // Invoice print ''; @@ -355,8 +358,6 @@ if ($resql) // Third party print ''; - $thirdpartystatic->id=$objp->socid; - $thirdpartystatic->name=$objp->name; print $thirdpartystatic->getNomUrl(1); print ''; From 78259db0ee701f9f97a732297a111f84c38bf566 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 17:22:38 +0100 Subject: [PATCH 09/13] Intorduce dolDecodeBlockedData --- htdocs/blockedlog/admin/blockedlog_list.php | 2 +- htdocs/blockedlog/ajax/block-info.php | 6 +++ htdocs/blockedlog/class/blockedlog.class.php | 41 +++++++++++++++++++- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 9410ef9be5e..e8b2dc8b73b 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -196,7 +196,7 @@ else if (GETPOST('downloadcsv','alpha')) $block_static->user_fullname = $obj->user_fullname; $block_static->fk_user = $obj->fk_user; $block_static->signature = $obj->signature; - $block_static->object_data = unserialize($obj->object_data); + $block_static->object_data = $block_static->dolDecodeBlockedData($obj->object_data); $checksignature = $block_static->checkSignature($previoushash); // If $previoushash is not defined, checkSignature will search it diff --git a/htdocs/blockedlog/ajax/block-info.php b/htdocs/blockedlog/ajax/block-info.php index a092b13ca99..d4d4eef4e07 100644 --- a/htdocs/blockedlog/ajax/block-info.php +++ b/htdocs/blockedlog/ajax/block-info.php @@ -85,10 +85,16 @@ function formatObject($objtoshow, $prefix) { if (! is_object($val) && ! is_array($val)) { + // TODO $val can be '__PHP_Incomplete_Class', the is_object return false $s.=''.($prefix?$prefix.' > ':'').$key.''; $s.=''; if (in_array($key, array('date','datef','dateh','datec','datem','datep'))) { + /*var_dump(is_object($val)); + var_dump(is_array($val)); + var_dump(is_array($val)); + var_dump(@get_class($val)); + var_dump($val);*/ $s.=dol_print_date($val, 'dayhour'); } else diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 13a2840e360..ee41a139152 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -18,10 +18,23 @@ * See https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54 */ + + + +/*ini_set('unserialize_callback_func', 'mycallback'); + +function mycallback($classname) +{ + //var_dump($classname); + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + +}*/ + + + /** * Class to manage Blocked Log */ - class BlockedLog { /** @@ -636,7 +649,7 @@ class BlockedLog $this->fk_user = $obj->fk_user; $this->user_fullname = $obj->user_fullname; - $this->object_data = unserialize($obj->object_data); + $this->object_data = $this->dolDecodeBlockedData($obj->object_data); $this->signature = $obj->signature; $this->signature_line = $obj->signature_line; @@ -658,6 +671,30 @@ class BlockedLog } + + /** + * Decode data + * + * @param string $mode 0=unserialize, 1=json_decode + * @return string Value unserialized + */ + public function dolDecodeBlockedData($data, $mode=0) + { + try + { + //include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + //include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $aaa = unserialize($data); + //$aaa = unserialize($data); + } + catch(Exception $e) + { + //print $e->getErrs); + } + return $aaa; + } + + /** * Set block certified by authority * From 317a5f5b2f3aa109fbfb22d9e0b7cd737868c111 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 14:33:29 +0100 Subject: [PATCH 10/13] Fix by adding a redirect to avoid the order2billing being done twice. --- htdocs/commande/list.php | 2 +- htdocs/core/actions_massactions.inc.php | 29 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 29590820b72..4e589aa6529 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -670,7 +670,7 @@ if ($resql) // Status billed if (! empty($arrayfields['c.facture']['checked'])) { - print ''; + print ''; print $form->selectyesno('billed', $billed, 1, 0, 1); print ''; } diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index fae976dec80..5a713168c48 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -686,6 +686,35 @@ if ($massaction == 'confirm_createbills') { $db->commit(); setEventMessage($langs->trans('BillCreated', $nb_bills_created)); + + // Make a redirect to avoid to bill twice if we make a refresh or back + $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + if ($sall) $param.='&sall='.urlencode($sall); + if ($socid > 0) $param.='&socid='.urlencode($socid); + if ($viewstatut != '') $param.='&viewstatut='.urlencode($viewstatut); + if ($search_orderday) $param.='&search_orderday='.urlencode($search_orderday); + if ($search_ordermonth) $param.='&search_ordermonth='.urlencode($search_ordermonth); + if ($search_orderyear) $param.='&search_orderyear='.urlencode($search_orderyear); + if ($search_deliveryday) $param.='&search_deliveryday='.urlencode($search_deliveryday); + if ($search_deliverymonth) $param.='&search_deliverymonth='.urlencode($search_deliverymonth); + if ($search_deliveryyear) $param.='&search_deliveryyear='.urlencode($search_deliveryyear); + if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_company) $param.='&search_company='.urlencode($search_company); + if ($search_ref_customer) $param.='&search_ref_customer='.urlencode($search_ref_customer); + if ($search_user > 0) $param.='&search_user='.urlencode($search_user); + if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale); + if ($search_total_ht != '') $param.='&search_total_ht='.urlencode($search_total_ht); + if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat); + if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc); + if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); + if ($show_files) $param.='&show_files=' .urlencode($show_files); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($billed != '') $param.='&billed='.urlencode($billed); + + header("Location: ".$_SERVER['PHP_SELF'].'?'.$param); + exit; } else { From cab61724f28e044922309ee1cfc14f407b4a9452 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 19:33:43 +0100 Subject: [PATCH 11/13] Fix phpcs --- htdocs/blockedlog/class/blockedlog.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index ee41a139152..8c35ec11834 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -675,8 +675,9 @@ class BlockedLog /** * Decode data * + * @param string $data Data to unserialize * @param string $mode 0=unserialize, 1=json_decode - * @return string Value unserialized + * @return string Value unserialized */ public function dolDecodeBlockedData($data, $mode=0) { From d8dcebfa9aec5eb867bf9ff3d679019c50c3ceef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Mar 2018 20:12:40 +0100 Subject: [PATCH 12/13] FIX Do not lose filter when editing comment of a time spent in task view --- htdocs/projet/tasks/time.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index cbfdc48eae9..79ff8f9d9b0 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -987,13 +987,14 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) { if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) { + //$param = ($projectidforalltimes?'projectid='.$projectidforalltimes.'&':'').'.($withproject?'&withproject=1':''); print ' '; - print 'rowid.($withproject?'&withproject=1':'').'">'; + print 'rowid.$param.'">'; print img_edit(); print ''; print ' '; - print 'rowid.($withproject?'&withproject=1':'').'">'; + print 'rowid.$param.'">'; print img_delete(); print ''; } From 7a7c4b8f14e8ca1c3ef5a1e1820171562c3f5d2c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Mar 2018 14:41:13 +0100 Subject: [PATCH 13/13] Fix invalid url --- htdocs/public/paybox/paymentok.php | 2 +- htdocs/public/payment/paymentok.php | 2 +- htdocs/public/paypal/paymentok.php | 2 +- htdocs/public/stripe/paymentok.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 63c15b035f2..9e711ade51b 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -157,7 +157,7 @@ if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) if (! empty($tmptag['MEM'])) { $langs->load("members"); - $url=$urlwithroot."/adherents/card_subscriptions.php?rowid=".$tmptag['MEM']; + $url=$urlwithroot."/adherents/subscription.php?rowid=".$tmptag['MEM']; $content.=$langs->trans("PaymentSubscription")."
\n"; $content.=$langs->trans("MemberId").': '.$tmptag['MEM']."
\n"; $content.=$langs->trans("Link").': '.$url.''."
\n"; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index d74305890df..6f01ed9f991 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -322,7 +322,7 @@ if ($ispaymentok) if (! empty($tmptag['MEM'])) { $langs->load("members"); - $url=$urlwithroot."/adherents/card_subscriptions.php?rowid=".$tmptag['MEM']; + $url=$urlwithroot."/adherents/subscription.php?rowid=".$tmptag['MEM']; $content.=$langs->trans("PaymentSubscription")."
\n"; $content.=$langs->trans("MemberId").': '.$tmptag['MEM']."
\n"; $content.=$langs->trans("Link").': '.$url.''."
\n"; diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 80ec1d8ec2b..1e6adb7ca51 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -212,7 +212,7 @@ if ($PAYPALTOKEN) if (! empty($tmptag['MEM'])) { $langs->load("members"); - $url=$urlwithroot."/adherents/card_subscriptions.php?rowid=".$tmptag['MEM']; + $url=$urlwithroot."/adherents/subscription.php?rowid=".$tmptag['MEM']; $content.=$langs->trans("PaymentSubscription")."
\n"; $content.=$langs->trans("MemberId").': '.$tmptag['MEM']."
\n"; $content.=$langs->trans("Link").': '.$url.''."
\n"; diff --git a/htdocs/public/stripe/paymentok.php b/htdocs/public/stripe/paymentok.php index d0ce82d1ca8..52b3dac8a7f 100644 --- a/htdocs/public/stripe/paymentok.php +++ b/htdocs/public/stripe/paymentok.php @@ -158,7 +158,7 @@ if ($ispaymentok) if (! empty($tmptag['MEM'])) { $langs->load("members"); - $url=$urlwithroot."/adherents/card_subscriptions.php?rowid=".$tmptag['MEM']; + $url=$urlwithroot."/adherents/subscription.php?rowid=".$tmptag['MEM']; $content.=$langs->trans("PaymentSubscription")."
\n"; $content.=$langs->trans("MemberId").': '.$tmptag['MEM']."
\n"; $content.=$langs->trans("Link").': '.$url.''."
\n";