Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
744b0b0e45
@ -309,7 +309,7 @@ $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($
|
|||||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
$url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/studs.php',1).'?sondage='.$object->id_sondage;
|
$url=$urlwithouturlroot.dol_buildpath('/public/opensurvey/studs.php',1).'?sondage='.$object->id_sondage;
|
||||||
$urllink='<a href="'.$url.'" target="_blank">'.$url.'</a>';
|
$urllink='<a href="'.$url.'" target="_blank">'.$url.'</a>';
|
||||||
print $urllink;
|
print $urllink;
|
||||||
|
|
||||||
|
|||||||
@ -480,7 +480,7 @@ $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($
|
|||||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
$url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/studs.php',1).'?sondage='.$numsondage;
|
$url=$urlwithouturlroot.dol_buildpath('/public/opensurvey/studs.php',1).'?sondage='.$numsondage;
|
||||||
$urlvcal='<a href="'.$url.'" target="_blank">'.$url.'</a>';
|
$urlvcal='<a href="'.$url.'" target="_blank">'.$url.'</a>';
|
||||||
print $urlvcal;
|
print $urlvcal;
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre"))
|
|||||||
$testdate = false;
|
$testdate = false;
|
||||||
$champdatefin = dol_mktime(0,0,0,GETPOST('champdatefinmonth'),GETPOST('champdatefinday'),GETPOST('champdatefinyear'));
|
$champdatefin = dol_mktime(0,0,0,GETPOST('champdatefinmonth'),GETPOST('champdatefinday'),GETPOST('champdatefinyear'));
|
||||||
|
|
||||||
if (GETPOST('champdatefin') && ($champdatefin > 0)) // A date was provided
|
if ($champdatefin && ($champdatefin > 0)) // A date was provided
|
||||||
{
|
{
|
||||||
// Expire date is not before today
|
// Expire date is not before today
|
||||||
if ($champdatefin >= dol_now())
|
if ($champdatefin >= dol_now())
|
||||||
@ -90,16 +90,17 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre"))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$testdate = true;
|
$testdate = true;
|
||||||
|
$_SESSION['champdatefin'] = dol_print_date($champdatefin,'dayrfc');
|
||||||
//$testdate = false;
|
//$testdate = false;
|
||||||
//$_SESSION['champdatefin'] = dol_print_date($champdatefin,'dayrfc');
|
//$_SESSION['champdatefin'] = dol_print_date($champdatefin,'dayrfc');
|
||||||
//setEventMessage($langs->trans('ExpiredDate'),'errors');
|
setEventMessage($langs->trans('ExpiredDate'),'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $testdate) {
|
if (! $testdate) {
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("ExpireDate")), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("ExpireDate")), 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($titre && $testdate)
|
if ($titre && $testdate)
|
||||||
{
|
{
|
||||||
if (! empty($creation_sondage_date))
|
if (! empty($creation_sondage_date))
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/opensurvey/public/studs.php
|
* \file htdocs/public/opensurvey/studs.php
|
||||||
* \ingroup opensurvey
|
* \ingroup opensurvey
|
||||||
* \brief Page to list surveys
|
* \brief Page to list surveys
|
||||||
*/
|
*/
|
||||||
@ -111,12 +111,14 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nom=substr(GETPOST("nom"),0,64);
|
$nom=substr(GETPOST("nom"),0,64);
|
||||||
|
|
||||||
// Check if vote already exists
|
// Check if vote already exists
|
||||||
$sql = 'SELECT id_users, nom as name';
|
$sql = 'SELECT id_users, nom as name';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX."opensurvey_user_studs';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_user_studs';
|
||||||
$sql.= ' WHERE id_sondage='".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."' ORDER BY id_users";
|
$sql.= " WHERE id_sondage='".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."' ORDER BY id_users";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
if (! $resql) dol_print_error($db);
|
||||||
|
|
||||||
$num_rows = $db->num_rows($resql);
|
$num_rows = $db->num_rows($resql);
|
||||||
if ($num_rows > 0)
|
if ($num_rows > 0)
|
||||||
{
|
{
|
||||||
Loading…
Reference in New Issue
Block a user