diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 7b8f453c94c..29f1f94e683 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -337,11 +337,14 @@ class Subscription extends CommonObject /** * Return clicable name (with picto eventually) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param int $notooltip 1=Disable tooltip - * @return string Chaine avec URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $notooltip 1=Disable tooltip + * @param string $option Page for link ('', 'nolink', ...) + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine avec URL */ - function getNomUrl($withpicto=0, $notooltip=0) + function getNomUrl($withpicto=0, $notooltip=0, $option='', $morecss='', $save_lastsearch_value=-1) { global $langs; @@ -350,8 +353,18 @@ class Subscription extends CommonObject $langs->load("members"); $label=$langs->trans("ShowSubscription").': '.$this->ref; - $linkstart = ''; - $linkend=''; + $url = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$this->id; + + if ($option != 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } + + $linkstart = ''; + $linkend = ''; $picto='payment'; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 94950f02b05..e458bf093f6 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -191,7 +191,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; print "\n"; print ''; @@ -290,7 +290,7 @@ if ($rowid && $action != 'edit') print ''; print ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'rowid', $linkback, 1); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 9eed2238f80..4b3e24d019e 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -159,7 +159,7 @@ if ($search_ref) } if ($search_lastname) $sql.= natural_search(array('d.lastname','d.societe'), $search_lastname); if ($search_firstname) $sql.= natural_search(array('d.firstname'), $search_firstname); -if ($search_login) $sql.= natural_search('c.subscription', $search_login); +if ($search_login) $sql.= natural_search('d.login', $search_login); if ($search_note) $sql.= natural_search('c.note', $search_note); if ($search_account > 0) $sql.= " AND b.fk_account = ".urldecode($search_account); if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1); @@ -234,7 +234,7 @@ $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); -if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); +//if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions);