| ';
print $langs->trans('CronObject')." | ";
- print "objectname."\" /> ";
+ print "objectname."\" /> ";
print " | ";
print "";
print $form->textwithpicto('', $langs->trans("CronObjectHelp"), 1, 'help');
diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php
index a334b36929e..dde8644571e 100644
--- a/htdocs/datapolicy/admin/setup.php
+++ b/htdocs/datapolicy/admin/setup.php
@@ -27,15 +27,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once '../lib/datapolicy.lib.php';
// Translations
-$langs->load('admin');
-$langs->load('companies');
-$langs->load('members');
-$langs->load('datapolicy@datapolicy');
-
-// Access control
-if (!$user->admin) {
- accessforbidden();
-}
+$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy@datapolicy'));
// Parameters
$action = GETPOST('action', 'aZ09');
@@ -43,35 +35,27 @@ $backtopage = GETPOST('backtopage', 'alpha');
$arrayofparameters = array();
$arrayofparameters['ThirdParty'] = array(
- 'DATAPOLICY_TIERS_CLIENT'=>array('css'=>'minwidth200'),
- 'DATAPOLICY_TIERS_PROSPECT'=>array('css'=>'minwidth200'),
- 'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
- 'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
- 'DATAPOLICY_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200'),
+ 'DATAPOLICY_TIERS_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')),
+ 'DATAPOLICY_TIERS_PROSPECT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')),
+ 'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')),
+ 'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')),
+ 'DATAPOLICY_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'supplier', 'class="pictofixedwidth"')),
);
if (!empty($conf->global->DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT)) {
$arrayofparameters['Contact'] = array(
- 'DATAPOLICY_CONTACT_CLIENT'=>array('css'=>'minwidth200'),
- 'DATAPOLICY_CONTACT_PROSPECT'=>array('css'=>'minwidth200'),
- 'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
- 'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
- 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200'),
+ 'DATAPOLICY_CONTACT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
+ 'DATAPOLICY_CONTACT_PROSPECT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
+ 'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
+ 'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
+ 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
);
}
if (!empty($conf->adherent->enabled)) {
$arrayofparameters['Member'] = array(
- 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200'),
+ 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')),
);
}
-
-
-/*
- * Actions
- */
-
-include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-
$valTab = array(
'' => $langs->trans('Never'),
'6' => $langs->trans('NB_MONTHS', 6),
@@ -85,6 +69,40 @@ $valTab = array(
'240' => $langs->trans('NB_YEARS', 20),
);
+// Access control
+if (!$user->admin) {
+ accessforbidden();
+}
+
+
+/*
+ * Actions
+ */
+
+foreach ($arrayofparameters as $title => $tab) {
+ foreach ($tab as $key => $val) {
+ // Modify constant only if key was posted (avoid resetting key to the null value)
+ if (GETPOSTISSET($key)) {
+ if (preg_match('/category:/', $val['type'])) {
+ if (GETPOST($key, 'int') == '-1') {
+ $val_const = '';
+ } else {
+ $val_const = GETPOST($key, 'int');
+ }
+ } else {
+ $val_const = GETPOST($key, 'alpha');
+ }
+
+ $result = dolibarr_set_const($db, $key, $val_const, 'chaine', 0, '', $conf->entity);
+ if ($result < 0) {
+ $error++;
+ break;
+ }
+ }
+ }
+}
+
+
/*
* View
@@ -96,11 +114,11 @@ llxHeader('', $langs->trans($page_name));
// Subheader
$linkback = ''.$langs->trans("BackToModuleList").'';
-print load_fiche_titre($langs->trans($page_name), $linkback, 'object_generic');
+print load_fiche_titre($langs->trans($page_name), $linkback, 'generic');
// Configuration header
$head = datapolicyAdminPrepareHead();
-print dol_get_fiche_head($head, 'settings', '', -1, "datapolicy@datapolicy");
+print dol_get_fiche_head($head, 'settings', '', -1, '');
// Setup page goes here
echo ''.$langs->trans("datapolicySetupPage").'
';
@@ -118,6 +136,7 @@ if ($action == 'edit') {
print ' |
| ';
+ print $val['picto'];
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
print ' | ';
print ' |
';
// Timing (Duration sum of linked fichinter)
- if ($conf->fichinter->enabled) {
+ if ($conf->ficheinter->enabled) {
$object->fetchObjectLinked();
$num = count($object->linkedObjects);
$timing = 0;
diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php
index 740061f99ba..5e4d80cd8be 100644
--- a/htdocs/ticket/document.php
+++ b/htdocs/ticket/document.php
@@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$langs->loadLangs(array("companies", "other", "ticket", "mails"));
$id = GETPOST('id', 'int');
+$socid = GETPOST('socid', 'int');
$ref = GETPOST('ref', 'alpha');
$track_id = GETPOST('track_id', 'alpha');
$action = GETPOST('action', 'alpha');
@@ -104,7 +105,7 @@ if ($object->id) {
print dol_get_fiche_end();
}
- if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
+ if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
$object->next_prev_filter = "te.fk_user_assign = '".$user->id."'";
} elseif ($user->socid > 0) {
$object->next_prev_filter = "te.fk_soc = '".$user->socid."'";
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 19b352ee936..45a11a9daef 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -118,7 +118,7 @@ foreach ($object->fields as $key => $val) {
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array();
foreach ($object->fields as $key => $val) {
- if ($val['searchall']) {
+ if (!empty($val['searchall'])) {
$fieldstosearchall['t.'.$key] = $val['label'];
}
}
@@ -340,7 +340,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/, $/', '', $sql);
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
-if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
+if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)";
diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index 527b28c8fac..c3e70def7da 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -91,7 +91,7 @@ if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
accessforbidden();
}
// or for unauthorized internals users
-if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
+if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
accessforbidden();
}
@@ -146,7 +146,7 @@ if ($socid > 0) {
print dol_get_fiche_end();
}
-if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
+if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
$object->next_prev_filter = "te.fk_user_assign = '".$user->id."'";
} elseif ($user->socid > 0) {
$object->next_prev_filter = "te.fk_soc = '".$user->socid."'";