Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
98b227bdc9
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012-2020 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012-2020 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -1564,7 +1564,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
|
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
|
||||||
} else {
|
} else {
|
||||||
if ($object->user_id) {
|
if ($object->user_id) {
|
||||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
|
$linkeduser = new User($db);
|
||||||
|
$linkeduser->fetch($object->user_id);
|
||||||
|
print $linkeduser->getNomUrl(-1);
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("NoDolibarrAccess");
|
print $langs->trans("NoDolibarrAccess");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,7 +101,7 @@ class SimpleOpenID
|
|||||||
/**
|
/**
|
||||||
* SetRequiredFields
|
* SetRequiredFields
|
||||||
*
|
*
|
||||||
* @param string $a Server
|
* @param string|array $a Server
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function SetRequiredFields($a)
|
public function SetRequiredFields($a)
|
||||||
@ -118,7 +118,7 @@ class SimpleOpenID
|
|||||||
/**
|
/**
|
||||||
* SetOptionalFields
|
* SetOptionalFields
|
||||||
*
|
*
|
||||||
* @param string $a Server
|
* @param string|array $a Server
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function SetOptionalFields($a)
|
public function SetOptionalFields($a)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -41,14 +41,13 @@ $cancel = GETPOST('cancel', 'alpha');
|
|||||||
$numsondage = '';
|
$numsondage = '';
|
||||||
|
|
||||||
if (GETPOST('id')) {
|
if (GETPOST('id')) {
|
||||||
$numsondage = GETPOST('id', 'alpha');
|
$numsondage = (string) GETPOST('id', 'alpha');
|
||||||
}
|
}
|
||||||
|
|
||||||
$object = new Opensurveysondage($db);
|
$object = new Opensurveysondage($db);
|
||||||
|
|
||||||
$result = $object->fetch(0, $numsondage);
|
$result = $object->fetch(0, $numsondage);
|
||||||
if ($result <= 0)
|
if ($result <= 0) {
|
||||||
{
|
|
||||||
dol_print_error($db, $object->error);
|
dol_print_error($db, $object->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -112,17 +111,16 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$object->title = GETPOST('nouveautitre', 'nohtml');
|
$object->title = (string) GETPOST('nouveautitre', 'alphanohtml');
|
||||||
$object->description = GETPOST('nouveauxcommentaires', 'restricthtml');
|
$object->description = (string) GETPOST('nouveauxcommentaires', 'restricthtml');
|
||||||
$object->mail_admin = GETPOST('nouvelleadresse', 'alpha');
|
$object->mail_admin = (string) GETPOST('nouvelleadresse', 'alpha');
|
||||||
$object->date_fin = $expiredate;
|
$object->date_fin = $expiredate;
|
||||||
$object->allow_comments = GETPOST('cancomment', 'alpha') == 'on' ? 1 : 0;
|
$object->allow_comments = GETPOST('cancomment', 'aZ09') == 'on' ? 1 : 0;
|
||||||
$object->allow_spy = GETPOST('canseeothersvote', 'alpha') == 'on' ? 1 : 0;
|
$object->allow_spy = GETPOST('canseeothersvote', 'aZ09') == 'on' ? 1 : 0;
|
||||||
$object->mailsonde = GETPOST('mailsonde', 'alpha') == 'on' ? true : false;
|
$object->mailsonde = GETPOST('mailsonde', 'aZ09') == 'on' ? true : false;
|
||||||
|
|
||||||
$res = $object->update($user);
|
$res = $object->update($user);
|
||||||
if ($res < 0)
|
if ($res < 0) {
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action = 'edit';
|
$action = 'edit';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -49,7 +50,6 @@ class Opensurveysondage extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $picto = 'poll';
|
public $picto = 'poll';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string ID survey
|
* @var string ID survey
|
||||||
*/
|
*/
|
||||||
@ -60,7 +60,14 @@ class Opensurveysondage extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string email admin
|
||||||
|
*/
|
||||||
public $mail_admin;
|
public $mail_admin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var admin name
|
||||||
|
*/
|
||||||
public $nom_admin;
|
public $nom_admin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -75,10 +82,25 @@ class Opensurveysondage extends CommonObject
|
|||||||
public $title;
|
public $title;
|
||||||
|
|
||||||
public $date_fin = '';
|
public $date_fin = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int status
|
||||||
|
*/
|
||||||
public $status = 1;
|
public $status = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string format of survey
|
||||||
|
*/
|
||||||
public $format;
|
public $format;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int mailsonde
|
||||||
|
*/
|
||||||
public $mailsonde;
|
public $mailsonde;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string subject
|
||||||
|
*/
|
||||||
public $sujet;
|
public $sujet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -133,8 +155,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
$this->cleanParameters();
|
$this->cleanParameters();
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (!$this->date_fin > 0)
|
if (!$this->date_fin > 0) {
|
||||||
{
|
|
||||||
$this->error = 'BadValueForEndDate';
|
$this->error = 'BadValueForEndDate';
|
||||||
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
@ -156,10 +177,10 @@ class Opensurveysondage extends CommonObject
|
|||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= "'".$this->db->escape($this->id_sondage)."',";
|
$sql .= "'".$this->db->escape($this->id_sondage)."',";
|
||||||
$sql .= " ".(empty($this->description) ? 'NULL' : "'".$this->db->escape($this->description)."'").",";
|
$sql .= " ".(empty($this->description) ? 'NULL' : "'".$this->db->escape($this->description)."'").",";
|
||||||
$sql .= " ".$user->id.",";
|
$sql .= " ".(int) $user->id.",";
|
||||||
$sql .= " '".$this->db->escape($this->title)."',";
|
$sql .= " '".$this->db->escape($this->title)."',";
|
||||||
$sql .= " '".$this->db->idate($this->date_fin)."',";
|
$sql .= " '".$this->db->idate($this->date_fin)."',";
|
||||||
$sql .= " ".$this->status.",";
|
$sql .= " ".(int) $this->status.",";
|
||||||
$sql .= " '".$this->db->escape($this->format)."',";
|
$sql .= " '".$this->db->escape($this->format)."',";
|
||||||
$sql .= " ".$this->db->escape($this->mailsonde).",";
|
$sql .= " ".$this->db->escape($this->mailsonde).",";
|
||||||
$sql .= " ".$this->db->escape($this->allow_comments).",";
|
$sql .= " ".$this->db->escape($this->allow_comments).",";
|
||||||
@ -173,24 +194,18 @@ class Opensurveysondage extends CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||||
|
|
||||||
if (!$error)
|
if (!$error && !$notrigger) {
|
||||||
{
|
global $langs, $conf;
|
||||||
if (!$notrigger)
|
|
||||||
{
|
|
||||||
global $langs, $conf;
|
|
||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('OPENSURVEY_CREATE', $user);
|
$result = $this->call_trigger('OPENSURVEY_CREATE', $user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error)
|
if ($error) {
|
||||||
{
|
foreach ($this->errors as $errmsg) {
|
||||||
foreach ($this->errors as $errmsg)
|
|
||||||
{
|
|
||||||
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
|
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
|
||||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||||
}
|
}
|
||||||
@ -310,10 +325,12 @@ class Opensurveysondage extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
if (!$resql) {
|
||||||
|
$error++;
|
||||||
|
$this->errors[] = "Error ".$this->db->lasterror();
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error && !$notrigger)
|
if (!$error && !$notrigger) {
|
||||||
{
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('OPENSURVEY_MODIFY', $user);
|
$result = $this->call_trigger('OPENSURVEY_MODIFY', $user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
@ -356,15 +373,11 @@ class Opensurveysondage extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (!$error)
|
if (!$error && !$notrigger) {
|
||||||
{
|
// Call trigger
|
||||||
if (!$notrigger)
|
$result = $this->call_trigger('OPENSURVEY_DELETE', $user);
|
||||||
{
|
if ($result < 0) $error++;
|
||||||
// Call trigger
|
// End call triggers
|
||||||
$result = $this->call_trigger('OPENSURVEY_DELETE', $user);
|
|
||||||
if ($result < 0) $error++;
|
|
||||||
// End call triggers
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
@ -441,7 +454,9 @@ class Opensurveysondage extends CommonObject
|
|||||||
}
|
}
|
||||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
|
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
|
||||||
} else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
} else {
|
||||||
|
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
||||||
|
}
|
||||||
|
|
||||||
$linkstart = '<a href="'.$url.'"';
|
$linkstart = '<a href="'.$url.'"';
|
||||||
$linkstart .= $linkclose.'>';
|
$linkstart .= $linkclose.'>';
|
||||||
@ -591,7 +606,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
$this->mail_admin = trim($this->mail_admin);
|
$this->mail_admin = trim($this->mail_admin);
|
||||||
$this->nom_admin = trim($this->nom_admin);
|
$this->nom_admin = trim($this->nom_admin);
|
||||||
$this->title = trim($this->title);
|
$this->title = trim($this->title);
|
||||||
$this->status = trim($this->status);
|
$this->status = (int) $this->status;
|
||||||
$this->format = trim($this->format);
|
$this->format = trim($this->format);
|
||||||
$this->mailsonde = ($this->mailsonde ? 1 : 0);
|
$this->mailsonde = ($this->mailsonde ? 1 : 0);
|
||||||
$this->allow_comments = ($this->allow_comments ? 1 : 0);
|
$this->allow_comments = ($this->allow_comments ? 1 : 0);
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2015-2018 Charlene Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2015-2018 Charlene Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2018 David Beniamine <David.Beniamine@Tetras-Libre.fr>
|
* Copyright (C) 2018 David Beniamine <David.Beniamine@Tetras-Libre.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -1781,7 +1781,7 @@ if ($action == 'create' || $action == 'adduserldap')
|
|||||||
$adh = new Adherent($db);
|
$adh = new Adherent($db);
|
||||||
$adh->fetch($object->fk_member);
|
$adh->fetch($object->fk_member);
|
||||||
$adh->ref = $adh->getFullname($langs); // Force to show login instead of id
|
$adh->ref = $adh->getFullname($langs); // Force to show login instead of id
|
||||||
print $adh->getNomUrl(1);
|
print $adh->getNomUrl(-1);
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("UserNotLinkedToMember");
|
print $langs->trans("UserNotLinkedToMember");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
|||||||
// Load translation files required by page
|
// Load translation files required by page
|
||||||
$langs->loadLangs(array('users', 'admin'));
|
$langs->loadLangs(array('users', 'admin'));
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = (string) GETPOST('action', 'aZ09');
|
||||||
$id = GETPOST('id', 'int');
|
$id = (int) GETPOST('id', 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
@ -54,14 +54,13 @@ if (empty($reshook)) {
|
|||||||
$edituser = new User($db);
|
$edituser = new User($db);
|
||||||
$edituser->fetch($id);
|
$edituser->fetch($id);
|
||||||
|
|
||||||
$edituser->clicktodial_url = GETPOST("url");
|
$edituser->clicktodial_url = (string) GETPOST("url", "alpha");
|
||||||
$edituser->clicktodial_login = GETPOST("login");
|
$edituser->clicktodial_login = (string) GETPOST("login", "alpha");
|
||||||
$edituser->clicktodial_password = GETPOST("password");
|
$edituser->clicktodial_password = (string) GETPOST("password", "alpha");
|
||||||
$edituser->clicktodial_poste = GETPOST("poste");
|
$edituser->clicktodial_poste = (string) GETPOST("poste", "alpha");
|
||||||
|
|
||||||
$result = $edituser->update_clicktodial();
|
$result = $edituser->update_clicktodial();
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
setEventMessages($edituser->error, $edituser->errors, 'errors');
|
setEventMessages($edituser->error, $edituser->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user