diff --git a/ChangeLog b/ChangeLog
index fcf5af4aef6..790d5b329b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -141,7 +141,7 @@ NEW: Added MMK currency (Myanmar Kyat)
Modules
NEW: Module Partnership Management
-NEW: Experimental Module Event Organization Management
+NEW: Module Event Organization Management
For developers or integrators:
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 43747513c96..5cce7e1345e 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1560,7 +1560,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// 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));
+ $formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (getDolGlobalString('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'=>'');
@@ -1591,7 +1591,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$outputlangs->loadLangs(array("main", "members"));
// Get email content from template
$arraydefaultmessage = null;
- $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
+ $labeltouse = getDolGlobalString('ADHERENT_EMAIL_TEMPLATE_CANCELATION');
if (!empty($labeltouse)) {
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 318dc4ac794..a0a7d7bba0a 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -972,10 +972,10 @@ class Adherent extends CommonObject
}
/**
- * Fonction qui supprime l'adherent et les donnees associees
+ * Fonction to delete a member and its data
*
* @param int $rowid Id of member to delete
- * @param User $user User object
+ * @param User $user User object
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, 0=nothing to do, >0 if OK
*/
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 86ec35139e1..12735e70211 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -440,6 +440,7 @@ class AdherentType extends CommonObject
/**
* Function to delete the member's status
+ * TODO Add param "User $user"
*
* @return int > 0 if OK, 0 if not found, < 0 if KO
*/
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index e37d52480fa..b40d7772e99 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -41,6 +41,7 @@ $langs->load("members");
$rowid = GETPOST('rowid', 'int');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$sall = GETPOST("sall", "alpha");
@@ -202,7 +203,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
exit;
}
-if ($action == 'confirm_delete' && $user->rights->adherent->configurer) {
+if ($action == 'confirm_delete' && !empty($user->rights->adherent->configurer)) {
$object->fetch($rowid);
$res = $object->delete();
@@ -448,7 +449,7 @@ if ($rowid > 0) {
print '
';
print '
';
- print '
';
+ print '';
// Morphy
print ''.$langs->trans("MembersNature").' '.$object->getmorphylib($object->morphy).' ';
@@ -682,20 +683,23 @@ if ($rowid > 0) {
print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
print " \n";
- while ($i < $num && $i < $conf->liste_limit) {
+ $adh = new Adherent($db);
+
+ $imaxinloop = ($limit ? min($num, $limit) : $num);
+ while ($i < $imaxinloop) {
$objp = $db->fetch_object($resql);
$datefin = $db->jdate($objp->datefin);
- $adh = new Adherent($db);
$adh->lastname = $objp->lastname;
$adh->firstname = $objp->firstname;
$adh->datefin = $datefin;
$adh->need_subscription = $objp->subscription;
$adh->statut = $objp->status;
- // Lastname
print '';
+
+ // Lastname
if ($objp->company != '') {
print ''.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->company, 12).' '."\n";
} else {
@@ -703,7 +707,7 @@ if ($rowid > 0) {
}
// Login
- print "".$objp->login." \n";
+ print "".dol_escape_htmltag($objp->login)." \n";
// Type
/*print '';
@@ -760,11 +764,15 @@ if ($rowid > 0) {
$i++;
}
+ if ($i == 0) {
+ print ' '.$langs->trans("None").' ';
+ }
+
print "
\n";
print '';
print '';
- if ($num > $conf->liste_limit) {
+ if ($num > $limit) {
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
}
} else {
diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php
index 72976d4e65f..d7d062a1e5f 100644
--- a/htdocs/adherents/type_translation.php
+++ b/htdocs/adherents/type_translation.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
// Load translation files required by the page
$langs->loadLangs(array('members', 'languages'));
-$id = GETPOST('rowid', 'int');
+$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$ref = GETPOST('ref', 'alphanohtml');
@@ -61,7 +61,12 @@ if ($cancel == $langs->trans("Cancel")) {
if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) {
$object = new AdherentType($db);
$object->fetch($id);
- $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
+ $result = $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
+ if ($result > 0) {
+ setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
+ header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id);
+ exit;
+ }
}
// Add translation
diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php
index 05df4187130..66c6cc9a204 100644
--- a/htdocs/admin/eventorganization.php
+++ b/htdocs/admin/eventorganization.php
@@ -228,14 +228,14 @@ if ($action == 'edit') {
if ($val['type'] == 'textarea') {
print '\n";
} elseif ($val['type']== 'html') {
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
- $doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
+ $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
$doleditor->Create();
} elseif ($val['type'] == 'yesno') {
- print $form->selectyesno($constname, $conf->global->{$constname}, 1);
+ print $form->selectyesno($constname, getDolGlobalString($constname), 1);
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
@@ -255,7 +255,7 @@ if ($action == 'edit') {
$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
}
}
- print $form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname}, 'None', 0, 0, '', 0, 0, 0, '', '', 1);
+ print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1);
} elseif (preg_match('/category:/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
@@ -263,13 +263,13 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']);
print img_picto('', 'category', 'class="pictofixedwidth"');
- print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
+ print $formother->select_categories($tmp[1], getDolGlobalString($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db);
- print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1);
+ print $formcompany->selectProspectCustomerType(getDolGlobalString($constname), $constname, 'customerorprospect', 'form', '', 1);
} elseif ($val['type'] == 'securekey') {
- print ' ';
+ print ' ';
if (!empty($conf->use_javascript_ajax)) {
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
}
@@ -283,7 +283,7 @@ if ($action == 'edit') {
$form->select_produits($selected, $constname, '', 0);
}
} else {
- print ' ';
+ print ' ';
}
print '';
}
@@ -309,28 +309,28 @@ if ($action == 'edit') {
print '';
if ($val['type'] == 'textarea') {
- print dol_nl2br($conf->global->{$constname});
+ print dol_nl2br(getDolGlobalString($constname));
} elseif ($val['type']== 'html') {
- print $conf->global->{$constname};
+ print getDolGlobalString($constname);
} elseif ($val['type'] == 'yesno') {
print ajax_constantonoff($constname);
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
- if (!empty($conf->global->{$constname})) {
+ if (getDolGlobalString($constname)) {
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$tmp = explode(':', $val['type']);
- $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname});
+ $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname));
if ($template < 0) {
setEventMessages(null, $formmail->errors, 'errors');
}
print $langs->trans($template->label);
}
} elseif (preg_match('/category:/', $val['type'])) {
- if (!empty($conf->global->{$constname})) {
+ if (getDolGlobalString($constname)) {
$c = new Categorie($db);
- $result = $c->fetch($conf->global->{$constname});
+ $result = $c->fetch(getDolGlobalString($constname));
if ($result < 0) {
setEventMessages(null, $c->errors, 'errors');
}
@@ -342,25 +342,25 @@ if ($action == 'edit') {
print '' . implode(' ', $toprint) . ' ';
}
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
- if ($conf->global->{$constname}==2) {
+ if (getDolGlobalString($constname)==2) {
print $langs->trans("Prospect");
- } elseif ($conf->global->{$constname}==3) {
+ } elseif (getDolGlobalString($constname)==3) {
print $langs->trans("ProspectCustomer");
- } elseif ($conf->global->{$constname}==1) {
+ } elseif (getDolGlobalString($constname)==1) {
print $langs->trans("Customer");
- } elseif ($conf->global->{$constname}==0) {
+ } elseif (getDolGlobalString($constname)==0) {
print $langs->trans("NorProspectNorCustomer");
}
} elseif ($val['type'] == 'product') {
$product = new Product($db);
- $resprod = $product->fetch($conf->global->{$constname});
+ $resprod = $product->fetch(getDolGlobalString($constname));
if ($resprod > 0) {
print $product->getNomUrl(1);
} elseif ($resprod < 0) {
- setEventMessages(null, $object->errors, "errors");
+ setEventMessages($product->error, $product->errors, "errors");
}
} else {
- print $conf->global->{$constname};
+ print getDolGlobalString($constname);
}
print ' ';
}
diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php
index db62dfe6a9f..75cbefec3ec 100644
--- a/htdocs/comm/action/class/cactioncomm.class.php
+++ b/htdocs/comm/action/class/cactioncomm.class.php
@@ -216,7 +216,9 @@ class CActionComm
if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) {
$qualified = 1;
}
- if (preg_split("/@/", $obj->module, -1)[1] == 'eventorganization' && !empty($conf->eventorganization->enabled)) {
+ // For case module = 'myobject@eventorganization'
+ $tmparray = preg_split("/@/", $obj->module, -1);
+ if (count($tmparray) > 1 && $tmparray[1] == 'eventorganization' && !empty($conf->eventorganization->enabled)) {
$qualified = 1;
}
// For the generic case with type = 'module...' and module = 'myobject@mymodule'
diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php
index 0ba88228666..f19c3e03684 100644
--- a/htdocs/contact/consumption.php
+++ b/htdocs/contact/consumption.php
@@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
$id = GETPOST('id', 'int');
@@ -46,7 +47,7 @@ if (empty($object->thirdparty)) {
$socid = $object->thirdparty->id;
// Sort & Order fields
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -230,7 +231,7 @@ if ($type_element == 'fichinter') { // Customer : show products from invoices
$tables_from .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = '.((int) $object->id);
$tables_from .= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='propal' and tc.source='external' and tc.active=1)";
$where = ' WHERE c.entity IN ('.getEntity('propal').')';
- $datePrint = 'c.datep';
+ $dateprint = 'c.datep';
$doc_number = 'c.ref';
$thirdTypeSelect = 'customer';
} elseif ($type_element == 'order') {
@@ -443,6 +444,8 @@ if ($sql_select) {
$i = 0;
+ $total_qty = 0;
+ $total_ht = 0;
while (($objp = $db->fetch_object($resql)) && $i < min($num, $limit)) {
$documentstatic->id = $objp->doc_id;
$documentstatic->ref = $objp->doc_number;
diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php
index b05709f019a..e88c056af37 100644
--- a/htdocs/contact/project.php
+++ b/htdocs/contact/project.php
@@ -76,7 +76,11 @@ if ($id) {
$linkback = ''.$langs->trans("BackToList").' ';
- $morehtmlref = '