diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 947d0a9d2f8..f906c4cab45 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -49,10 +49,10 @@ $usergroup = GETPOST("search_usergroup", "int", 3) ?GETPOST("search_usergroup", $showbirthday = 0; // If not choice done on calendar owner, we filter on user. -if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) +/*if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) { $filtert = $user->id; -} +}*/ $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 94e885d53dc..b85826339e5 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -423,24 +423,24 @@ if ($object->fetch($id) >= 0) { $linkback = ''.$langs->trans("BackToList").''; - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print ''; print $form->showrefnav($object, 'id', $linkback); print ''; - print ''.$langs->trans("MailTitle").''.$object->titre.''; + print ''.$langs->trans("MailTitle").''.$object->titre.''; - print ''.$langs->trans("MailFrom").''.dol_print_email($object->email_from, 0, 0, 0, 0, 1).''; + print ''.$langs->trans("MailFrom").''.dol_print_email($object->email_from, 0, 0, 0, 0, 1).''; // Errors to - print ''.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1); + print ''.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1); print ''; // Status - print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; + print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; // Nb of distinct emails - print ''; + print ''; print $langs->trans("TotalNbOfDistinctRecipients"); print ''; $nbemail = ($object->nbemail ? $object->nbemail : '0'); diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 0b47d8c4aa5..da1775955b7 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -141,7 +141,7 @@ class AdvanceTargetingMailing extends CommonObject $sql .= " ".(!isset($this->filtervalue) ? 'NULL' : "'".$this->db->escape($this->filtervalue)."'").","; $sql .= " ".$user->id.","; $sql .= " '".$this->db->idate(dol_now())."',"; - $sql .= " null"; + $sql.= " ".$user->id; $sql .= ")"; $this->db->begin(); diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 08736a3d268..f5acafcfb19 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -418,9 +418,10 @@ class FormAdvTargetEmailing extends Form * @param integer $selected defaut selected * @param integer $showempty empty lines * @param string $type_element Type element. Example: 'mailing' + * @param string $morecss More CSS * @return string HTML combo */ - public function selectAdvtargetemailingTemplate($htmlname = 'template_id', $selected = 0, $showempty = 0, $type_element = 'mailing') + public function selectAdvtargetemailingTemplate($htmlname = 'template_id', $selected = 0, $showempty = 0, $type_element = 'mailing', $morecss = '') { global $conf, $user, $langs; @@ -434,7 +435,7 @@ class FormAdvTargetEmailing extends Form dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $out .= ''; if ($showempty) $out .= ''; $num = $this->db->num_rows($resql); diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 174da6b5869..4682fb62af3 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -38,6 +38,9 @@ $action=GETPOST("action", "alpha"); $refund=GETPOST("refund", "int"); if (empty($refund)) $refund=0; +$datev=dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); +$datep=dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) $socid=$user->socid; @@ -81,12 +84,9 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) { $error=0; - $datev=dol_mktime(12, 0, 0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); - $datep=dol_mktime(12, 0, 0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]); - - $object->accountid=GETPOST("accountid"); - $object->type_payment=GETPOST("type_payment"); - $object->num_payment=GETPOST("num_payment"); + $object->accountid=GETPOST("accountid", 'int'); + $object->type_payment=GETPOST("type_payment", 'alphanohtml'); + $object->num_payment=GETPOST("num_payment", 'alphanohtml'); $object->datev=$datev; $object->datep=$datep; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 1ea2dae72a6..dd1810fdf5f 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -545,7 +545,9 @@ function calendars_prepare_head($param) $h++; } - $head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($param?'?'.$param:''); + $newparam = $param; + $newparam = preg_replace('/&?search_filtert=\d+/', '', $newparam); + $head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($newparam?'?'.$newparam:''); $head[$h][1] = $langs->trans("ViewPerUser"); $head[$h][2] = 'cardperuser'; $h++; diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php index 59bb080d93e..cb4e5cf8b29 100644 --- a/htdocs/core/lib/emailing.lib.php +++ b/htdocs/core/lib/emailing.lib.php @@ -48,7 +48,7 @@ function emailing_prepare_head(Mailing $object) $h++; } - if (! empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR)) + if ( empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR)) { $head[$h][0] = DOL_URL_ROOT."/comm/mailing/advtargetemailing.php?id=".$object->id; $head[$h][1] = $langs->trans("MailAdvTargetRecipients"); diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 478c2dfa4b8..b3b6b5d1bf1 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -58,24 +58,27 @@ print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; -print '' . "\n"; + +print ''."\n"; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 3eb35ed2628..048ca869dfe 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2147,7 +2147,7 @@ else print ''; print '
'."\n"; -print ''."\n"; +print ''."\n"; print '
'.$langs->trans('AdvTgtNameTemplate').''; +print '
'.$langs->trans('AdvTgtNameTemplate').''; if (!empty($template_id)) { $default_template = $template_id; } else { $default_template = $advTarget->id; } -print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template, 0, $advTarget->type_element); -print ''; -print ''; -print ''; -print $langs->trans('AdvTgtOrCreateNewFilter'); +print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template, 0, $advTarget->type_element, 'valignmiddle'); +print ''; +print ''; +print ''; +print '' . "\n"; +print '
' . $langs->trans('AdvTgtOrCreateNewFilter') . ''; print ''; -print ''; +print ''; print ''."\n"; print '
'; if ($user->admin && !$object->ldap_sid) { - print ''; + print ''; } else { @@ -2173,7 +2173,7 @@ else { if ($caneditpassword) { - $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; + $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; } else { diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 2f78e66c22d..c722b7adc36 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1145,7 +1145,21 @@ class Website extends CommonObject } } - // Regenerate index page to point to new index page + // Read record of website that has been updated by the run_sql function previously called so we can get the + // value of fk_default_home that is ID of home page + $sql = 'SELECT fk_default_home FROM '.MAIN_DB_PREFIX.'website WHERE rowid = '.$object->id; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + if ($obj) { + $object->fk_default_home = $obj->fk_default_home; + } else { + //$this->errors[] = 'Failed to get the Home page'; + //$error++; + } + } + + // Regenerate index page to point to the new index page $pathofwebsite = $conf->website->dir_output.'/'.$object->ref; dolSaveIndexPage($pathofwebsite, $pathofwebsite.'/index.php', $pathofwebsite.'/page'.$object->fk_default_home.'.tpl.php', $pathofwebsite.'/wrapper.php'); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 3d523a6d48c..85b50b3d13b 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2822,7 +2822,7 @@ if ($action == 'createsite') print '
'; print $langs->trans('Ref'); print ''; - print ''; + print ''; print '
';