diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 417d4cd2c99c0..2a8177df6f227 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -43,19 +43,19 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page
-$langs->loadLangs(array("companies","bills","members","users","other"));
-
-$action=GETPOST('action', 'alpha');
-$cancel=GETPOST('cancel', 'alpha');
-$backtopage=GETPOST('backtopage', 'alpha');
-$confirm=GETPOST('confirm', 'alpha');
-$rowid=GETPOST('rowid', 'int');
-$id=GETPOST('id')?GETPOST('id', 'int'):$rowid;
-$typeid=GETPOST('typeid', 'int');
-$userid=GETPOST('userid', 'int');
-$socid=GETPOST('socid', 'int');
-
-if (! empty($conf->mailmanspip->enabled))
+$langs->loadLangs(array("companies", "bills", "members", "users", "other"));
+
+$action = GETPOST('action', 'alpha');
+$cancel = GETPOST('cancel', 'alpha');
+$backtopage = GETPOST('backtopage', 'alpha');
+$confirm = GETPOST('confirm', 'alpha');
+$rowid = GETPOST('rowid', 'int');
+$id = GETPOST('id') ?GETPOST('id', 'int') : $rowid;
+$typeid = GETPOST('typeid', 'int');
+$userid = GETPOST('userid', 'int');
+$socid = GETPOST('socid', 'int');
+
+if (!empty($conf->mailmanspip->enabled))
{
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@@ -74,9 +74,9 @@
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($id);
-$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
-$objcanvas=null;
-if (! empty($canvas))
+$canvas = $object->canvas ? $object->canvas : GETPOST("canvas");
+$objcanvas = null;
+if (!empty($canvas))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
$objcanvas = new Canvas($db, $action);
@@ -84,7 +84,7 @@
}
// Security check
-$result=restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', $objcanvas);
+$result = restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', $objcanvas);
if ($id > 0)
{
@@ -92,28 +92,28 @@
$result = $object->fetch($id);
// Define variables to know what current user can do on users
- $canadduser=($user->admin || $user->rights->user->user->creer);
+ $canadduser = ($user->admin || $user->rights->user->user->creer);
// Define variables to know what current user can do on properties of user linked to edited member
if ($object->user_id)
{
// $User is the user who edits, $object->user_id is the id of the related user in the edited member
- $caneditfielduser=((($user->id == $object->user_id) && $user->rights->user->self->creer)
+ $caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer)
|| (($user->id != $object->user_id) && $user->rights->user->user->creer));
- $caneditpassworduser=((($user->id == $object->user_id) && $user->rights->user->self->password)
+ $caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
|| (($user->id != $object->user_id) && $user->rights->user->user->password));
}
}
// Define variables to determine what the current user can do on the members
-$canaddmember=$user->rights->adherent->creer;
+$canaddmember = $user->rights->adherent->creer;
// Define variables to determine what the current user can do on the properties of a member
if ($id)
{
- $caneditfieldmember=$user->rights->adherent->creer;
+ $caneditfieldmember = $user->rights->adherent->creer;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
-$hookmanager->initHooks(array('membercard','globalcard'));
+$hookmanager->initHooks(array('membercard', 'globalcard'));
@@ -121,25 +121,25 @@
* Actions
*/
-$parameters=array('id'=>$id, 'rowid'=>$id, 'objcanvas'=>$objcanvas, 'confirm'=>$confirm);
-$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+$parameters = array('id'=>$id, 'rowid'=>$id, 'objcanvas'=>$objcanvas, 'confirm'=>$confirm);
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if ($cancel)
{
- if (! empty($backtopage))
+ if (!empty($backtopage))
{
header("Location: ".$backtopage);
exit;
}
- $action='';
+ $action = '';
}
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
{
- $error=0;
+ $error = 0;
if (empty($user->rights->user->user->creer)) // If can edit only itself user, we can link to itself only
{
if ($userid != $user->id && $userid != $object->user_id)
@@ -149,47 +149,47 @@
}
}
- if (! $error)
+ if (!$error)
{
if ($userid != $object->user_id) // If link differs from currently in database
{
- $result=$object->setUserId($userid);
+ $result = $object->setUserId($userid);
if ($result < 0) dol_print_error($object->db, $object->error);
- $action='';
+ $action = '';
}
}
}
if ($action == 'setsocid')
{
- $error=0;
- if (! $error)
+ $error = 0;
+ if (!$error)
{
if ($socid != $object->socid) // If link differs from currently in database
{
- $sql ="SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
- $sql.=" WHERE socid = '".$socid."'";
- $sql.=" AND entity = ".$conf->entity;
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
+ $sql .= " WHERE socid = '".$socid."'";
+ $sql .= " AND entity = ".$conf->entity;
$resql = $db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($obj && $obj->rowid > 0)
{
- $othermember=new Adherent($db);
+ $othermember = new Adherent($db);
$othermember->fetch($obj->rowid);
- $thirdparty=new Societe($db);
+ $thirdparty = new Societe($db);
$thirdparty->fetch($socid);
$error++;
setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors');
}
}
- if (! $error)
+ if (!$error)
{
- $result=$object->setThirdPartyId($socid);
+ $result = $object->setThirdPartyId($socid);
if ($result < 0) dol_print_error($object->db, $object->error);
- $action='';
+ $action = '';
}
}
}
@@ -202,7 +202,7 @@
{
// Creation user
$nuser = new User($db);
- $result=$nuser->create_from_member($object, GETPOST('login'));
+ $result = $nuser->create_from_member($object, GETPOST('login'));
if ($result < 0)
{
@@ -223,7 +223,7 @@
{
// User creation
$company = new Societe($db);
- $result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'));
+ $result = $company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'));
if ($result < 0)
{
@@ -238,29 +238,29 @@
}
}
- if ($action == 'update' && ! $cancel && $user->rights->adherent->creer)
+ if ($action == 'update' && !$cancel && $user->rights->adherent->creer)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
- $birthdate='';
+ $birthdate = '';
if (isset($_POST["birthday"]) && $_POST["birthday"]
&& isset($_POST["birthmonth"]) && $_POST["birthmonth"]
&& isset($_POST["birthyear"]) && $_POST["birthyear"])
{
- $birthdate=dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]);
+ $birthdate = dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]);
}
- $lastname=$_POST["lastname"];
- $firstname=$_POST["firstname"];
+ $lastname = $_POST["lastname"];
+ $firstname = $_POST["firstname"];
$gender = $_POST["gender"];
- $societe=$_POST["societe"];
- $morphy=$_POST["morphy"];
- $login=$_POST["login"];
+ $societe = $_POST["societe"];
+ $morphy = $_POST["morphy"];
+ $login = $_POST["login"];
if ($morphy != 'mor' && empty($lastname)) {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")), null, 'errors');
}
- if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
+ if ($morphy != 'mor' && (!isset($firstname) || $firstname == '')) {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors');
@@ -279,7 +279,7 @@
}
}
// Create new object
- if ($result > 0 && ! $error)
+ if ($result > 0 && !$error)
{
$object->oldcopy = clone $object;
@@ -291,7 +291,7 @@
$object->login = trim(GETPOST("login", 'alpha'));
$object->pass = trim(GETPOST("pass", 'alpha'));
- $object->societe = trim(GETPOST("societe", 'alpha')); // deprecated
+ $object->societe = trim(GETPOST("societe", 'alpha')); // deprecated
$object->company = trim(GETPOST("societe", 'alpha'));
$object->address = trim(GETPOST("address", 'alpha'));
@@ -302,11 +302,11 @@
$object->phone = trim(GETPOST("phone", 'alpha'));
$object->phone_perso = trim(GETPOST("phone_perso", 'alpha'));
- $object->phone_mobile= trim(GETPOST("phone_mobile", 'alpha'));
+ $object->phone_mobile = trim(GETPOST("phone_mobile", 'alpha'));
$object->email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
$object->socialnetworks = array();
foreach ($socialnetworks as $key => $value) {
- if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
+ if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = trim(GETPOST($key, 'alphanohtml'));
}
}
@@ -320,8 +320,8 @@
//$object->note = trim(GETPOST("comment","alpha"));
$object->morphy = GETPOST("morphy", 'alpha');
- if (GETPOST('deletephoto', 'alpha')) $object->photo='';
- elseif (! empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
+ if (GETPOST('deletephoto', 'alpha')) $object->photo = '';
+ elseif (!empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
// Get status and public property
$object->statut = GETPOST("statut", 'alpha');
@@ -332,36 +332,36 @@
if ($ret < 0) $error++;
// Check if we need to also synchronize user information
- $nosyncuser=0;
+ $nosyncuser = 0;
if ($object->user_id) // If linked to a user
{
- if ($user->id != $object->user_id && empty($user->rights->user->user->creer)) $nosyncuser=1; // Disable synchronizing
+ if ($user->id != $object->user_id && empty($user->rights->user->user->creer)) $nosyncuser = 1; // Disable synchronizing
}
// Check if we need to also synchronize password information
- $nosyncuserpass=0;
+ $nosyncuserpass = 0;
if ($object->user_id) // If linked to a user
{
- if ($user->id != $object->user_id && empty($user->rights->user->user->password)) $nosyncuserpass=1; // Disable synchronizing
+ if ($user->id != $object->user_id && empty($user->rights->user->user->password)) $nosyncuserpass = 1; // Disable synchronizing
}
- $result=$object->update($user, 0, $nosyncuser, $nosyncuserpass);
+ $result = $object->update($user, 0, $nosyncuser, $nosyncuserpass);
- if ($result >= 0 && ! count($object->errors))
+ if ($result >= 0 && !count($object->errors))
{
$categories = GETPOST('memcats', 'array');
$object->setCategories($categories);
// Logo/Photo save
- $dir= $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 1, $object, 'member').'/photos';
+ $dir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos';
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
if ($file_OK)
{
if (GETPOST('deletephoto'))
{
- require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
- $fileimg=$conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/'.$object->photo;
- $dirthumbs=$conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/thumbs';
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ $fileimg = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/'.$object->photo;
+ $dirthumbs = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/thumbs';
dol_delete_file($fileimg);
dol_delete_dir_recursive($dirthumbs);
}
@@ -372,8 +372,8 @@
if (@is_dir($dir))
{
- $newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
- if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0)
+ $newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
+ if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0)
{
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
}
@@ -391,7 +391,7 @@
}
else
{
- switch($_FILES['photo']['error'])
+ switch ($_FILES['photo']['error'])
{
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form
@@ -403,11 +403,11 @@
}
}
- $rowid=$object->id;
- $id=$object->id;
- $action='';
+ $rowid = $object->id;
+ $id = $object->id;
+ $action = '';
- if (! empty($backtopage))
+ if (!empty($backtopage))
{
header("Location: ".$backtopage);
exit;
@@ -416,67 +416,67 @@
else
{
setEventMessages($object->error, $object->errors, 'errors');
- $action='';
+ $action = '';
}
}
else
{
- $action='edit';
+ $action = 'edit';
}
}
if ($action == 'add' && $user->rights->adherent->creer)
{
- if ($canvas) $object->canvas=$canvas;
- $birthdate='';
+ if ($canvas) $object->canvas = $canvas;
+ $birthdate = '';
if (isset($_POST["birthday"]) && $_POST["birthday"]
&& isset($_POST["birthmonth"]) && $_POST["birthmonth"]
&& isset($_POST["birthyear"]) && $_POST["birthyear"])
{
- $birthdate=dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]);
+ $birthdate = dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]);
}
- $datesubscription='';
+ $datesubscription = '';
if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"]))
{
- $datesubscription=dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+ $datesubscription = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
}
- $typeid=GETPOST("typeid", 'int');
- $civility_id=GETPOST("civility_id", 'alpha');
- $lastname=GETPOST("lastname", 'alpha');
- $firstname=GETPOST("firstname", 'alpha');
- $gender=GETPOST("gender", 'alpha');
- $societe=GETPOST("societe", 'alpha');
- $address=GETPOST("address", 'alpha');
- $zip=GETPOST("zipcode", 'alpha');
- $town=GETPOST("town", 'alpha');
- $state_id=GETPOST("state_id", 'int');
- $country_id=GETPOST("country_id", 'int');
+ $typeid = GETPOST("typeid", 'int');
+ $civility_id = GETPOST("civility_id", 'alpha');
+ $lastname = GETPOST("lastname", 'alpha');
+ $firstname = GETPOST("firstname", 'alpha');
+ $gender = GETPOST("gender", 'alpha');
+ $societe = GETPOST("societe", 'alpha');
+ $address = GETPOST("address", 'alpha');
+ $zip = GETPOST("zipcode", 'alpha');
+ $town = GETPOST("town", 'alpha');
+ $state_id = GETPOST("state_id", 'int');
+ $country_id = GETPOST("country_id", 'int');
- $phone=GETPOST("phone", 'alpha');
- $phone_perso=GETPOST("phone_perso", 'alpha');
- $phone_mobile=GETPOST("phone_mobile", 'alpha');
+ $phone = GETPOST("phone", 'alpha');
+ $phone_perso = GETPOST("phone_perso", 'alpha');
+ $phone_mobile = GETPOST("phone_mobile", 'alpha');
// $skype=GETPOST("member_skype", 'alpha');
// $twitter=GETPOST("member_twitter", 'alpha');
// $facebook=GETPOST("member_facebook", 'alpha');
// $linkedin=GETPOST("member_linkedin", 'alpha');
- $email=preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
- $login=GETPOST("member_login", 'alpha');
- $pass=GETPOST("password", 'alpha');
- $photo=GETPOST("photo", 'alpha');
+ $email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
+ $login = GETPOST("member_login", 'alpha');
+ $pass = GETPOST("password", 'alpha');
+ $photo = GETPOST("photo", 'alpha');
//$comment=GETPOST("comment",'none');
- $morphy=GETPOST("morphy", 'alpha');
- $subscription=GETPOST("subscription", 'alpha');
- $public=GETPOST("public", 'alpha');
+ $morphy = GETPOST("morphy", 'alpha');
+ $subscription = GETPOST("subscription", 'alpha');
+ $public = GETPOST("public", 'alpha');
- $userid=GETPOST("userid", 'int');
- $socid=GETPOST("socid", 'int');
+ $userid = GETPOST("userid", 'int');
+ $socid = GETPOST("socid", 'int');
$object->civility_id = $civility_id;
$object->firstname = $firstname;
$object->lastname = $lastname;
$object->gender = $gender;
- $object->societe = $societe; // deprecated
+ $object->societe = $societe; // deprecated
$object->company = $societe;
$object->address = $address;
$object->zip = $zip;
@@ -485,11 +485,11 @@
$object->country_id = $country_id;
$object->phone = $phone;
$object->phone_perso = $phone_perso;
- $object->phone_mobile= $phone_mobile;
+ $object->phone_mobile = $phone_mobile;
$object->socialnetworks = array();
- if (! empty($conf->socialnetworks->enabled)) {
+ if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
- if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
+ if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = GETPOST("member_".$key, 'alphanohtml');
}
}
@@ -509,7 +509,7 @@
//$object->note = $comment;
$object->morphy = $morphy;
$object->user_id = $userid;
- $object->socid = $socid;
+ $object->socid = $socid;
$object->public = $public;
// Fill array 'array_options' with data from add form
@@ -555,29 +555,29 @@
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")), null, 'errors');
}
- if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
+ if ($morphy != 'mor' && (!isset($firstname) || $firstname == '')) {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors');
}
- if (! ($typeid > 0)) { // Keep () before !
+ if (!($typeid > 0)) { // Keep () before !
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
}
- if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) {
+ if ($conf->global->ADHERENT_MAIL_REQUIRED && !isValidEMail($email)) {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors');
}
- $public=0;
- if (isset($public)) $public=1;
+ $public = 0;
+ if (isset($public)) $public = 1;
- if (! $error)
+ if (!$error)
{
$db->begin();
// Email about right and login does not exist
- $result=$object->create($user);
+ $result = $object->create($user);
if ($result > 0)
{
// Foundation categories
@@ -585,9 +585,9 @@
$object->setCategories($memcats);
$db->commit();
- $rowid=$object->id;
- $id=$object->id;
- $action='';
+ $rowid = $object->id;
+ $id = $object->id;
+ $action = '';
}
else
{
@@ -609,10 +609,10 @@
if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confirm == 'yes')
{
- $result=$object->delete($id, $user);
+ $result = $object->delete($id, $user);
if ($result > 0)
{
- if (! empty($backtopage))
+ if (!empty($backtopage))
{
header("Location: ".$backtopage);
exit;
@@ -625,44 +625,44 @@
}
else
{
- $errmesg=$object->error;
+ $errmesg = $object->error;
}
}
if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == 'yes')
{
- $error=0;
+ $error = 0;
$db->begin();
$adht = new AdherentType($db);
$adht->fetch($object->typeid);
- $result=$object->validate($user);
+ $result = $object->validate($user);
- if ($result >= 0 && ! count($object->errors))
+ if ($result >= 0 && !count($object->errors))
{
// Send confirmation email (according to parameters of member type. Otherwise generic)
if ($object->email && GETPOST("send_mail"))
{
$subject = '';
- $msg= '';
+ $msg = '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
- $formmail=new FormMail($db);
+ $formmail = new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
// Get email content from template
- $arraydefaultmessage=null;
+ $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
- if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
+ if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
- if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
+ if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
@@ -674,14 +674,14 @@
$error++;
}
else {
- $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
- $moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
+ $moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
- $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
+ $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$error++;
@@ -700,7 +700,7 @@
}
}
- if (! $error)
+ if (!$error)
{
$db->commit();
}
@@ -708,7 +708,7 @@
{
$db->rollback();
}
- $action='';
+ $action = '';
}
if ($user->rights->adherent->supprimer && $action == 'confirm_resign')
@@ -720,30 +720,30 @@
$adht = new AdherentType($db);
$adht->fetch($object->typeid);
- $result=$object->resiliate($user);
+ $result = $object->resiliate($user);
- if ($result >= 0 && ! count($object->errors))
+ if ($result >= 0 && !count($object->errors))
{
if ($object->email && GETPOST("send_mail"))
{
$subject = '';
- $msg= '';
+ $msg = '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
- $formmail=new FormMail($db);
+ $formmail = new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
// Get email content from template
- $arraydefaultmessage=null;
+ $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
- if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
+ if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
- if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
+ if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
@@ -755,14 +755,14 @@
$error++;
}
else {
- $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
- $moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
+ $moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
- $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
+ $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$error++;
@@ -780,10 +780,10 @@
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
- $action='';
+ $action = '';
}
}
- if (! empty($backtopage) && ! $error)
+ if (!empty($backtopage) && !$error)
{
header("Location: ".$backtopage);
exit;
@@ -793,7 +793,7 @@
// SPIP Management
if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $confirm == 'yes')
{
- if (! count($object->errors))
+ if (!count($object->errors))
{
if (!$mailmanspip->del_to_spip($object))
{
@@ -804,7 +804,7 @@
if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm == 'yes')
{
- if (! count($object->errors))
+ if (!count($object->errors))
{
if (!$mailmanspip->add_to_spip($object))
{
@@ -818,14 +818,14 @@
// Actions to build doc
$upload_dir = $conf->adherent->dir_output;
- $permissiontoadd=$user->rights->adherent->creer;
+ $permissiontoadd = $user->rights->adherent->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
- $trigger_name='MEMBER_SENTBYMAIL';
- $paramname='id';
- $mode='emailfrommember';
- $trackid='mem'.$object->id;
+ $trigger_name = 'MEMBER_SENTBYMAIL';
+ $paramname = 'id';
+ $mode = 'emailfrommember';
+ $trackid = 'mem'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
}
@@ -838,11 +838,11 @@
$formfile = new FormFile($db);
$formcompany = new FormCompany($db);
-$title=$langs->trans("Member") . " - " . $langs->trans("Card");
-$help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
+$title = $langs->trans("Member")." - ".$langs->trans("Card");
+$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
llxHeader('', $title, $help_url);
-$countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
+$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
{
@@ -852,11 +852,11 @@
if (empty($object->error) && $id)
{
$object = new Adherent($db);
- $result=$object->fetch($id);
+ $result = $object->fetch($id);
if ($result <= 0) dol_print_error('', $object->error);
}
- $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
- $objcanvas->display_canvas($action); // Show template
+ $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
+ $objcanvas->display_canvas($action); // Show template
}
else
{
@@ -871,23 +871,23 @@
/* Creation mode */
/* */
/* ************************************************************************** */
- $object->canvas=$canvas;
+ $object->canvas = $canvas;
$object->state_id = GETPOST('state_id', 'int');
// We set country_id, country_code and country for the selected country
- $object->country_id=GETPOST('country_id', 'int')?GETPOST('country_id', 'int'):$mysoc->country_id;
+ $object->country_id = GETPOST('country_id', 'int') ?GETPOST('country_id', 'int') : $mysoc->country_id;
if ($object->country_id)
{
- $tmparray=getCountry($object->country_id, 'all');
- $object->country_code=$tmparray['code'];
- $object->country=$tmparray['label'];
+ $tmparray = getCountry($object->country_id, 'all');
+ $object->country_code = $tmparray['code'];
+ $object->country = $tmparray['label'];
}
if (!empty($socid)) {
$object = new Societe($db);
if ($socid > 0) $object->fetch($socid);
- if (! ($object->id > 0))
+ if (!($object->id > 0))
{
$langs->load("errors");
print($langs->trans('ErrorRecordNotFound'));
@@ -944,14 +944,14 @@ function initfieldrequired()
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
- print '
'.$langs->trans("Login").' / '.$langs->trans("Id").' login).'" autofocus="autofocus"> ';
+ print ''.$langs->trans("Login").' / '.$langs->trans("Id").' login).'" autofocus="autofocus"> ';
}
// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
- $generated_password=getRandomPassword(false);
+ $generated_password = getRandomPassword(false);
print ''.$langs->trans("Password").' ';
print ' ';
print ' ';
@@ -959,10 +959,10 @@ function initfieldrequired()
// Type
print ''.$langs->trans("MemberType").' ';
- $listetype=$adht->liste_array();
+ $listetype = $adht->liste_array();
if (count($listetype))
{
- print $form->selectarray("typeid", $listetype, GETPOST('typeid', 'int')?GETPOST('typeid', 'int'):$typeid, count($listetype)>1?1:0);
+ print $form->selectarray("typeid", $listetype, GETPOST('typeid', 'int') ?GETPOST('typeid', 'int') : $typeid, count($listetype) > 1 ? 1 : 0);
} else {
print ''.$langs->trans("NoTypeDefinedGoToSetup").' ';
}
@@ -972,51 +972,51 @@ function initfieldrequired()
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print ' '.$langs->trans("MemberNature")." \n";
- print $form->selectarray("morphy", $morphys, GETPOST('morphy', 'alpha')?GETPOST('morphy', 'alpha'):$object->morphy, 1);
+ print $form->selectarray("morphy", $morphys, GETPOST('morphy', 'alpha') ?GETPOST('morphy', 'alpha') : $object->morphy, 1);
print " \n";
// Company
- print ''.$langs->trans("Company").' ';
+ print ''.$langs->trans("Company").' ';
// Civility
print ''.$langs->trans("UserTitle").' ';
- print $formcompany->select_civility(GETPOST('civility_id', 'int')?GETPOST('civility_id', 'int'):$object->civility_id, 'civility_id').' ';
+ print $formcompany->select_civility(GETPOST('civility_id', 'int') ?GETPOST('civility_id', 'int') : $object->civility_id, 'civility_id').'';
print ' ';
// Lastname
- print ''.$langs->trans("Lastname").' ';
+ print ''.$langs->trans("Lastname").' ';
print ' ';
// Firstname
- print ''.$langs->trans("Firstname").' ';
+ print ''.$langs->trans("Firstname").' ';
print ' ';
// Gender
print ''.$langs->trans("Gender").' ';
print '';
- $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman"));
+ $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
print $form->selectarray('gender', $arraygender, GETPOST('gender'), 1);
print ' ';
// EMail
- print ''.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?' ':'').' ';
+ print ''.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? ' ' : '').' ';
// Address
print ''.$langs->trans("Address").' ';
- print '';
+ print '';
print ' ';
// Zip / Town
print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' ';
- print $formcompany->select_ziptown((GETPOST('zipcode', 'alphanohtml')?GETPOST('zipcode', 'alphanohtml'):$object->zip), 'zipcode', array('town','selectcountry_id','state_id'), 6);
+ print $formcompany->select_ziptown((GETPOST('zipcode', 'alphanohtml') ?GETPOST('zipcode', 'alphanohtml') : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
print ' ';
- print $formcompany->select_ziptown((GETPOST('town', 'alphanohtml')?GETPOST('town', 'alphanohtml'):$object->town), 'town', array('zipcode','selectcountry_id','state_id'));
+ print $formcompany->select_ziptown((GETPOST('town', 'alphanohtml') ?GETPOST('town', 'alphanohtml') : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id'));
print ' ';
// Country
- $object->country_id=$object->country_id?$object->country_id:$mysoc->country_id;
+ $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
print ''.$langs->trans('Country').' ';
- print $form->select_country(GETPOST('country_id', 'alpha')?GETPOST('country_id', 'alpha'):$object->country_id, 'country_id');
+ print $form->select_country(GETPOST('country_id', 'alpha') ?GETPOST('country_id', 'alpha') : $object->country_id, 'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print ' ';
@@ -1026,7 +1026,7 @@ function initfieldrequired()
print ''.$langs->trans('State').' ';
if ($object->country_id)
{
- print $formcompany->select_state(GETPOST('state_id', 'int')?GETPOST('state_id', 'int'):$object->state_id, $object->country_code);
+ print $formcompany->select_state(GETPOST('state_id', 'int') ?GETPOST('state_id', 'int') : $object->state_id, $object->country_code);
}
else
{
@@ -1036,18 +1036,18 @@ function initfieldrequired()
}
// Pro phone
- print ' '.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").' ';
+ print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").' ';
// Personal phone
- print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").' ';
+ print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").' ';
// Mobile phone
- print ''.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").' ';
+ print ''.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").' ';
- if (! empty($conf->socialnetworks->enabled)) {
+ if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if (!$value['active']) break;
- print ''.$langs->trans($value['label']).' ';
+ print ''.$langs->trans($value['label']).' ';
}
}
@@ -1062,9 +1062,9 @@ function initfieldrequired()
print "\n";
// Categories
- if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
+ if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire))
{
- print '' .$form->editfieldkey("Categories", 'memcats', '', $object, 0) . ' ';
+ print ' '.$form->editfieldkey("Categories", 'memcats', '', $object, 0).' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%');
print " ";
@@ -1073,7 +1073,7 @@ function initfieldrequired()
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
//Hooks here
- $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
@@ -1087,13 +1087,13 @@ function initfieldrequired()
print '';
print ' ';
print ' ';
- if (! empty($backtopage))
+ if (!empty($backtopage))
{
print ' ';
}
else
{
- print ' ';
+ print ' ';
}
print '
';
@@ -1108,11 +1108,11 @@ function initfieldrequired()
*
********************************************/
- $res=$object->fetch($id);
+ $res = $object->fetch($id);
if ($res < 0) {
dol_print_error($db, $object->error); exit;
}
- $res=$object->fetch_optionals();
+ $res = $object->fetch_optionals();
if ($res < 0) {
dol_print_error($db); exit;
}
@@ -1121,11 +1121,11 @@ function initfieldrequired()
$adht->fetch($object->typeid);
// We set country_id, and country_code, country of the chosen country
- $country=GETPOST('country', 'int');
+ $country = GETPOST('country', 'int');
if (!empty($country) || $object->country_id)
{
- $sql = "SELECT rowid, code, label from ".MAIN_DB_PREFIX."c_country where rowid = ".(!empty($country)?$country:$object->country_id);
- $resql=$db->query($sql);
+ $sql = "SELECT rowid, code, label from ".MAIN_DB_PREFIX."c_country where rowid = ".(!empty($country) ? $country : $object->country_id);
+ $resql = $db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
@@ -1134,9 +1134,9 @@ function initfieldrequired()
{
dol_print_error($db);
}
- $object->country_id=$obj->rowid;
- $object->country_code=$obj->code;
- $object->country=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label;
+ $object->country_id = $obj->rowid;
+ $object->country_code = $obj->code;
+ $object->country = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->label;
}
$head = member_prepare_head($object);
@@ -1190,26 +1190,26 @@ function initfieldrequired()
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
- print ''.$langs->trans("Login").' / '.$langs->trans("Id").' login).'"> ';
+ print ''.$langs->trans("Login").' / '.$langs->trans("Id").' login).'"> ';
}
// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
- print ''.$langs->trans("Password").' pass).'"> ';
+ print ''.$langs->trans("Password").' pass).'"> ';
}
// Morphy
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print ''.$langs->trans("MemberNature").' ';
- print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy")?GETPOST("morphy", 'alpha'):$object->morphy));
+ print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy") ?GETPOST("morphy", 'alpha') : $object->morphy));
print " ";
// Type
print ''.$langs->trans("Type").' ';
if ($user->rights->adherent->creer)
{
- print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid")?GETPOST("typeid", 'int'):$object->typeid));
+ print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ?GETPOST("typeid", 'int') : $object->typeid));
}
else
{
@@ -1219,27 +1219,27 @@ function initfieldrequired()
print " ";
// Company
- print ''.$langs->trans("Company").' company).'"> ';
+ print ''.$langs->trans("Company").' company).'"> ';
// Civility
print ''.$langs->trans("UserTitle").' ';
- print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id)."\n";
+ print $formcompany->select_civility(isset($_POST["civility_id"]) ? $_POST["civility_id"] : $object->civility_id)."\n";
print ' ';
print ' ';
// Lastname
- print ''.$langs->trans("Lastname").' lastname).'"> ';
+ print ''.$langs->trans("Lastname").' lastname).'"> ';
print ' ';
// Firstname
- print ''.$langs->trans("Firstname").' firstname).'"> ';
+ print ''.$langs->trans("Firstname").' firstname).'"> ';
print ' ';
// Gender
print ''.$langs->trans("Gender").' ';
print '';
- $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman"));
- print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1);
+ $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
+ print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1);
print ' ';
// Photo
@@ -1258,24 +1258,24 @@ function initfieldrequired()
print '';
// EMail
- print ''.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?' ':'').' email).'"> ';
+ print ''.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? ' ' : '').' email).'"> ';
// Address
print ''.$langs->trans("Address").' ';
- print '';
+ print '';
print ' ';
// Zip / Town
print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' ';
- print $formcompany->select_ziptown((isset($_POST["zipcode"])?GETPOST("zipcode", '', 2):$object->zip), 'zipcode', array('town','selectcountry_id','state_id'), 6);
+ print $formcompany->select_ziptown((isset($_POST["zipcode"]) ?GETPOST("zipcode", '', 2) : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
print ' ';
- print $formcompany->select_ziptown((isset($_POST["town"])?GETPOST("town", '', 2):$object->town), 'town', array('zipcode','selectcountry_id','state_id'));
+ print $formcompany->select_ziptown((isset($_POST["town"]) ?GETPOST("town", '', 2) : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id'));
print ' ';
// Country
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
print ''.$langs->trans('Country').' ';
- print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id, 'country_id');
+ print $form->select_country(isset($_POST["country_id"]) ? $_POST["country_id"] : $object->country_id, 'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print ' ';
@@ -1283,23 +1283,23 @@ function initfieldrequired()
if (empty($conf->global->MEMBER_DISABLE_STATE))
{
print ''.$langs->trans('State').' ';
- print $formcompany->select_state($object->state_id, isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id);
+ print $formcompany->select_state($object->state_id, isset($_POST["country_id"]) ?GETPOST("country_id") : $object->country_id);
print ' ';
}
// Pro phone
- print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").' phone).'"> ';
+ print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").' phone).'"> ';
// Personal phone
- print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").' phone_perso).'"> ';
+ print ''.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").' phone_perso).'"> ';
// Mobile phone
- print ''.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").' phone_mobile).'"> ';
+ print ''.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").' phone_mobile).'"> ';
- if (! empty($conf->socialnetworks->enabled)) {
+ if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if (!$value['active']) break;
- print ''.$langs->trans($value['label']).' ';
+ print ''.$langs->trans($value['label']).' ';
}
}
@@ -1310,13 +1310,13 @@ function initfieldrequired()
// Public profil
print "".$langs->trans("Public")." \n";
- print $form->selectyesno("public", (isset($_POST["public"])?GETPOST("public", '', 2):$object->public), 1);
+ print $form->selectyesno("public", (isset($_POST["public"]) ?GETPOST("public", '', 2) : $object->public), 1);
print " \n";
// Categories
- if (! empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire))
+ if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire))
{
- print '' . $form->editfieldkey("Categories", 'memcats', '', $object, 0) . ' ';
+ print ''.$form->editfieldkey("Categories", 'memcats', '', $object, 0).' ';
print '';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
$c = new Categorie($db);
@@ -1332,13 +1332,13 @@ function initfieldrequired()
}
// Third party Dolibarr
- if (! empty($conf->societe->enabled))
+ if (!empty($conf->societe->enabled))
{
print ' '.$langs->trans("LinkedToDolibarrThirdParty").' ';
if ($object->socid)
{
- $company=new Societe($db);
- $result=$company->fetch($object->socid);
+ $company = new Societe($db);
+ $result = $company->fetch($object->socid);
print $company->getNomUrl(1);
}
else
@@ -1380,17 +1380,17 @@ function initfieldrequired()
/* */
/* ************************************************************************** */
- $res=$object->fetch($id);
+ $res = $object->fetch($id);
if ($res < 0) {
dol_print_error($db, $object->error); exit;
}
- $res=$object->fetch_optionals();
+ $res = $object->fetch_optionals();
if ($res < 0) {
dol_print_error($db); exit;
}
$adht = new AdherentType($db);
- $res=$adht->fetch($object->typeid);
+ $res = $adht->fetch($object->typeid);
if ($res < 0) {
dol_print_error($db); exit;
}
@@ -1406,24 +1406,24 @@ function initfieldrequired()
// Confirm create user
if ($action == 'create_user')
{
- $login=$object->login;
+ $login = $object->login;
if (empty($login))
{
// Full firstname and name separated with a dot : firstname.name
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- $login=dol_buildlogin($object->lastname, $object->firstname);
+ $login = dol_buildlogin($object->lastname, $object->firstname);
}
- if (empty($login)) $login=strtolower(substr($object->firstname, 0, 4)) . strtolower(substr($object->lastname, 0, 4));
+ if (empty($login)) $login = strtolower(substr($object->firstname, 0, 4)).strtolower(substr($object->lastname, 0, 4));
// Create a form array
- $formquestion=array(
+ $formquestion = array(
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)
);
- $text=$langs->trans("ConfirmCreateLogin").' ';
- if (! empty($conf->societe->enabled))
+ $text = $langs->trans("ConfirmCreateLogin").' ';
+ if (!empty($conf->societe->enabled))
{
- if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser");
- else $text.=$langs->trans("UserWillBeInternalUser");
+ if ($object->socid > 0) $text .= $langs->trans("UserWillBeExternalUser");
+ else $text .= $langs->trans("UserWillBeInternalUser");
}
print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("CreateDolibarrLogin"), $text, "confirm_create_user", $formquestion, 'yes');
}
@@ -1431,22 +1431,22 @@ function initfieldrequired()
// Confirm create third party
if ($action == 'create_thirdparty')
{
- $companyalias='';
+ $companyalias = '';
$fullname = $object->getFullName($langs);
if ($object->morphy == 'mor')
{
- $companyname=$object->company;
- if (! empty($fullname)) $companyalias=$fullname;
+ $companyname = $object->company;
+ if (!empty($fullname)) $companyalias = $fullname;
}
else
{
- $companyname=$fullname;
- if (! empty($object->company)) $companyalias=$object->company;
+ $companyname = $fullname;
+ if (!empty($object->company)) $companyalias = $object->company;
}
// Create a form array
- $formquestion=array(
+ $formquestion = array(
array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'),
array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"')
);
@@ -1463,54 +1463,54 @@ function initfieldrequired()
$adht->fetch($object->typeid);
$subject = '';
- $msg= '';
+ $msg = '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
- $formmail=new FormMail($db);
+ $formmail = new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
// Get email content from template
- $arraydefaultmessage=null;
+ $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
- if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
+ if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
- if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
+ if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
- $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
- $tmp=$langs->trans("SendingAnEMailToMember");
- $tmp.=' '.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.' , ';
- $tmp.=' '.$langs->trans("MailRecipient").': '.$object->email.' ';
- $helpcontent='';
- $helpcontent.=''.$langs->trans("MailFrom").' : '.$conf->global->ADHERENT_MAIL_FROM.' '."\n";
- $helpcontent.=''.$langs->trans("MailRecipient").' : '.$object->email.' '."\n";
- $helpcontent.=''.$langs->trans("Subject").' : '."\n";
- $helpcontent.=$subjecttosend."\n";
- $helpcontent.=" ";
- $helpcontent.=''.$langs->trans("Content").' : ';
- $helpcontent.=dol_htmlentitiesbr($texttosend)."\n";
- $label=$form->textwithpicto($tmp, $helpcontent, 1, 'help');
+ $tmp = $langs->trans("SendingAnEMailToMember");
+ $tmp .= ' '.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.' , ';
+ $tmp .= ' '.$langs->trans("MailRecipient").': '.$object->email.' ';
+ $helpcontent = '';
+ $helpcontent .= ''.$langs->trans("MailFrom").' : '.$conf->global->ADHERENT_MAIL_FROM.' '."\n";
+ $helpcontent .= ''.$langs->trans("MailRecipient").' : '.$object->email.' '."\n";
+ $helpcontent .= ''.$langs->trans("Subject").' : '."\n";
+ $helpcontent .= $subjecttosend."\n";
+ $helpcontent .= " ";
+ $helpcontent .= ''.$langs->trans("Content").' : ';
+ $helpcontent .= dol_htmlentitiesbr($texttosend)."\n";
+ $label = $form->textwithpicto($tmp, $helpcontent, 1, 'help');
// Create form popup
- $formquestion=array();
- if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false));
- if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_MAILMAN)) {
- $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>'');
+ $formquestion = array();
+ if ($object->email) $formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL ?true:false));
+ if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_MAILMAN)) {
+ $formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"), 'value'=>'');
}
- if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) {
- $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>'');
+ if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) {
+ $formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"), 'value'=>'');
}
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, 'yes', 1, 220);
}
@@ -1524,58 +1524,58 @@ function initfieldrequired()
$adht->fetch($object->typeid);
$subject = '';
- $msg= '';
+ $msg = '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
- $formmail=new FormMail($db);
+ $formmail = new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
// Get email content from template
- $arraydefaultmessage=null;
+ $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
- if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
+ if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
- if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
+ if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
- $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
- $tmp=$langs->trans("SendingAnEMailToMember");
- $tmp.=' ('.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.' , ';
- $tmp.=$langs->trans("MailRecipient").': '.$object->email.' )';
- $helpcontent='';
- $helpcontent.=''.$langs->trans("MailFrom").' : '.$conf->global->ADHERENT_MAIL_FROM.' '."\n";
- $helpcontent.=''.$langs->trans("MailRecipient").' : '.$object->email.' '."\n";
- $helpcontent.=''.$langs->trans("Subject").' : '."\n";
- $helpcontent.=$subjecttosend."\n";
- $helpcontent.=" ";
- $helpcontent.=''.$langs->trans("Content").' : ';
- $helpcontent.=dol_htmlentitiesbr($texttosend)."\n";
- $label=$form->textwithpicto($tmp, $helpcontent, 1, 'help');
+ $tmp = $langs->trans("SendingAnEMailToMember");
+ $tmp .= ' ('.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.' , ';
+ $tmp .= $langs->trans("MailRecipient").': '.$object->email.' )';
+ $helpcontent = '';
+ $helpcontent .= ''.$langs->trans("MailFrom").' : '.$conf->global->ADHERENT_MAIL_FROM.' '."\n";
+ $helpcontent .= ''.$langs->trans("MailRecipient").' : '.$object->email.' '."\n";
+ $helpcontent .= ''.$langs->trans("Subject").' : '."\n";
+ $helpcontent .= $subjecttosend."\n";
+ $helpcontent .= " ";
+ $helpcontent .= ''.$langs->trans("Content").' : ';
+ $helpcontent .= dol_htmlentitiesbr($texttosend)."\n";
+ $label = $form->textwithpicto($tmp, $helpcontent, 1, 'help');
// Create an array
- $formquestion=array();
- if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
- if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
+ $formquestion = array();
+ if ($object->email) $formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? 'true' : 'false'));
+ if ($backtopage) $formquestion[] = array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ResiliateMember"), $langs->trans("ConfirmResiliateMember"), "confirm_resign", $formquestion, 'no', 1, 240);
}
// Confirm remove member
if ($action == 'delete')
{
- $formquestion=array();
- if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
+ $formquestion = array();
+ if ($backtopage) $formquestion[] = array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("DeleteMember"), $langs->trans("ConfirmDeleteMember"), "confirm_delete", $formquestion, 'no', 1);
}
@@ -1590,9 +1590,9 @@ function initfieldrequired()
print $form->formconfirm("card.php?rowid=$id", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip');
}
- $rowspan=17;
+ $rowspan = 17;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
- if (! empty($conf->societe->enabled)) $rowspan++;
+ if (!empty($conf->societe->enabled)) $rowspan++;
$linkback = ''.$langs->trans("BackToList").' ';
@@ -1640,10 +1640,10 @@ function initfieldrequired()
if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
else print $langs->trans("Hidden");
}
- if ((! empty($object->pass) || ! empty($object->pass_crypted)) && empty($object->user_id))
+ if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id))
{
$langs->load("errors");
- $htmltext=$langs->trans("WarningPasswordSetWithNoAccount");
+ $htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
}
print ' ';
@@ -1664,7 +1664,7 @@ function initfieldrequired()
{
print $langs->trans("SubscriptionNotNeeded");
}
- elseif (! $adht->subscription)
+ elseif (!$adht->subscription)
{
print $langs->trans("SubscriptionNotRecorded");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
@@ -1678,7 +1678,7 @@ function initfieldrequired()
print '';
// Third party Dolibarr
- if (! empty($conf->societe->enabled))
+ if (!empty($conf->societe->enabled))
{
print '';
$editenable = $user->rights->adherent->creer;
@@ -1686,7 +1686,7 @@ function initfieldrequired()
print ' ';
if ($action == 'editthirdparty')
{
- $htmlname='socid';
+ $htmlname = 'socid';
print '