mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-09 02:58:23 +01:00
Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -1666,7 +1666,7 @@ class ActionComm extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$canread = 0;
|
$canread = 0;
|
||||||
if (!empty($user->rights->agenda->myactions->read) && $this->authorid == $user->id) {
|
if ($user->hasRight('agenda', 'myactions', 'read') && ($this->authorid == $user->id || $this->userownerid == $user->id)) {
|
||||||
$canread = 1; // Can read my event
|
$canread = 1; // Can read my event
|
||||||
}
|
}
|
||||||
if (!empty($user->rights->agenda->myactions->read) && array_key_exists($user->id, $this->userassigned)) {
|
if (!empty($user->rights->agenda->myactions->read) && array_key_exists($user->id, $this->userassigned)) {
|
||||||
|
|||||||
@@ -934,6 +934,7 @@ while ($i < $imaxinloop) {
|
|||||||
$actionstatic->datep = $db->jdate($obj->dp);
|
$actionstatic->datep = $db->jdate($obj->dp);
|
||||||
$actionstatic->percentage = $obj->percent;
|
$actionstatic->percentage = $obj->percent;
|
||||||
$actionstatic->authorid = $obj->fk_user_author;
|
$actionstatic->authorid = $obj->fk_user_author;
|
||||||
|
$actionstatic->userownerid = $obj->fk_user_action;
|
||||||
|
|
||||||
// Initialize $this->userassigned && this->socpeopleassigned array && this->userownerid
|
// Initialize $this->userassigned && this->socpeopleassigned array && this->userownerid
|
||||||
// but only if we need it
|
// but only if we need it
|
||||||
|
|||||||
@@ -9884,10 +9884,10 @@ function dol_getmypid()
|
|||||||
* like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2
|
* like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2
|
||||||
* or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2
|
* or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2
|
||||||
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < -1000"
|
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < -1000"
|
||||||
* If param $mode is 2, can contains a list of int id separated by comma like "1,3,4"
|
* If param $mode is 2 or -2, can contains a list of int id separated by comma like "1,3,4"
|
||||||
* If param $mode is 3, can contains a list of string separated by comma like "a,b,c"
|
* If param $mode is 3 or -3, can contains a list of string separated by comma like "a,b,c".
|
||||||
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of ID separated with comma (Example '1,3,4')
|
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of ID separated with comma (Example '1,3,4'), -2 is for exclude list,
|
||||||
* 3=value is list of string separated with comma (Example 'text 1,text 2'), 4=value is a list of ID separated with comma (Example '2,7') to be used to search into a multiselect string '1,2,3,4'
|
* 3=value is list of string separated with comma (Example 'text 1,text 2'), -3 if for exclude list, 4=value is a list of ID separated with comma (Example '2,7') to be used to search into a multiselect string '1,2,3,4'
|
||||||
* @param integer $nofirstand 1=Do not output the first 'AND'
|
* @param integer $nofirstand 1=Do not output the first 'AND'
|
||||||
* @return string $res The statement to append to the SQL query
|
* @return string $res The statement to append to the SQL query
|
||||||
* @see dolSqlDateFilter()
|
* @see dolSqlDateFilter()
|
||||||
@@ -9902,7 +9902,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||||||
$value = preg_replace('/\*/', '%', $value); // Replace * with %
|
$value = preg_replace('/\*/', '%', $value); // Replace * with %
|
||||||
}
|
}
|
||||||
if ($mode == 1) {
|
if ($mode == 1) {
|
||||||
$value = preg_replace('/([!<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
$value = preg_replace('/([!<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can then explode on space to get all tests to do
|
||||||
}
|
}
|
||||||
|
|
||||||
$value = preg_replace('/\s*\|\s*/', '|', $value);
|
$value = preg_replace('/\s*\|\s*/', '|', $value);
|
||||||
@@ -9913,16 +9913,15 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||||||
$fields = array($fields);
|
$fields = array($fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
$j = 0;
|
$i1 = 0; // count the nb of and criteria added (all fields / criterias)
|
||||||
foreach ($crits as $crit) {
|
foreach ($crits as $crit) { // Loop on each AND criteria
|
||||||
$crit = trim($crit);
|
$crit = trim($crit);
|
||||||
$i = 0;
|
$i2 = 0; // count the nb of valid criteria added for this this first criteria
|
||||||
$i2 = 0;
|
|
||||||
$newres = '';
|
$newres = '';
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
if ($mode == 1) {
|
if ($mode == 1) {
|
||||||
$tmpcrits = explode('|', $crit);
|
$tmpcrits = explode('|', $crit);
|
||||||
$i3 = 0; // count the nb of valid criteria added for this field
|
$i3 = 0; // count the nb of valid criteria added for this current field
|
||||||
foreach ($tmpcrits as $tmpcrit) {
|
foreach ($tmpcrits as $tmpcrit) {
|
||||||
if ($tmpcrit !== '0' && empty($tmpcrit)) {
|
if ($tmpcrit !== '0' && empty($tmpcrit)) {
|
||||||
continue;
|
continue;
|
||||||
@@ -9949,7 +9948,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||||||
$i3++; // a criteria was added to string
|
$i3++; // a criteria was added to string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$i2++;
|
$i2++; // a criteria for 1 more field was added to string
|
||||||
} elseif ($mode == 2 || $mode == -2) {
|
} elseif ($mode == 2 || $mode == -2) {
|
||||||
$crit = preg_replace('/[^0-9,]/', '', $crit); // ID are always integer
|
$crit = preg_replace('/[^0-9,]/', '', $crit); // ID are always integer
|
||||||
$newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -2 ? 'NOT ' : '');
|
$newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -2 ? 'NOT ' : '');
|
||||||
@@ -9957,7 +9956,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||||||
if ($mode == -2) {
|
if ($mode == -2) {
|
||||||
$newres .= ' OR '.$field.' IS NULL';
|
$newres .= ' OR '.$field.' IS NULL';
|
||||||
}
|
}
|
||||||
$i2++; // a criteria was added to string
|
$i2++; // a criteria for 1 more field was added to string
|
||||||
} elseif ($mode == 3 || $mode == -3) {
|
} elseif ($mode == 3 || $mode == -3) {
|
||||||
$tmparray = explode(',', $crit);
|
$tmparray = explode(',', $crit);
|
||||||
if (count($tmparray)) {
|
if (count($tmparray)) {
|
||||||
@@ -9970,7 +9969,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -3 ? 'NOT ' : '')."IN (".$db->sanitize($listofcodes, 1).")";
|
$newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -3 ? 'NOT ' : '')."IN (".$db->sanitize($listofcodes, 1).")";
|
||||||
$i2++; // a criteria was added to string
|
$i2++; // a criteria for 1 more field was added to string
|
||||||
}
|
}
|
||||||
if ($mode == -3) {
|
if ($mode == -3) {
|
||||||
$newres .= ' OR '.$field.' IS NULL';
|
$newres .= ' OR '.$field.' IS NULL';
|
||||||
@@ -9987,20 +9986,20 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||||||
$newres .= ' OR '.$field." LIKE '%,".$db->escape($val)."'";
|
$newres .= ' OR '.$field." LIKE '%,".$db->escape($val)."'";
|
||||||
$newres .= ' OR '.$field." LIKE '%,".$db->escape($val).",%'";
|
$newres .= ' OR '.$field." LIKE '%,".$db->escape($val).",%'";
|
||||||
$newres .= ')';
|
$newres .= ')';
|
||||||
$i2++;
|
$i2++; // a criteria for 1 more field was added to string (we can add several citeria for the same field as it is a multiselect search criteria)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // $mode=0
|
} else { // $mode=0
|
||||||
$tmpcrits = explode('|', $crit);
|
$tmpcrits = explode('|', $crit);
|
||||||
$i3 = 0; // count the nb of valid criteria added for this field
|
$i3 = 0; // count the nb of valid criteria added for the current couple criteria/field
|
||||||
foreach ($tmpcrits as $tmpcrit) {
|
foreach ($tmpcrits as $tmpcrit) { // loop on each OR criteria
|
||||||
if ($tmpcrit !== '0' && empty($tmpcrit)) {
|
if ($tmpcrit !== '0' && empty($tmpcrit)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$tmpcrit = trim($tmpcrit);
|
$tmpcrit = trim($tmpcrit);
|
||||||
|
|
||||||
if ($tmpcrit == '^$') { // If we search empty, we must combined different fields with AND
|
if ($tmpcrit == '^$' || strpos($crit, '!') === 0) { // If we search empty, we must combined different OR fields with AND
|
||||||
$newres .= (($i2 > 0 || $i3 > 0) ? ' AND ' : '');
|
$newres .= (($i2 > 0 || $i3 > 0) ? ' AND ' : '');
|
||||||
} else {
|
} else {
|
||||||
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '');
|
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '');
|
||||||
@@ -10046,15 +10045,15 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||||||
|
|
||||||
$i3++;
|
$i3++;
|
||||||
}
|
}
|
||||||
$i2++; // a criteria was added to string
|
|
||||||
|
$i2++; // a criteria for 1 more field was added to string
|
||||||
}
|
}
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newres) {
|
if ($newres) {
|
||||||
$res = $res.($res ? ' AND ' : '').($i2 > 1 ? '(' : '').$newres.($i2 > 1 ? ')' : '');
|
$res = $res.($res ? ' AND ' : '').($i2 > 1 ? '(' : '').$newres.($i2 > 1 ? ')' : '');
|
||||||
}
|
}
|
||||||
$j++;
|
$i1++;
|
||||||
}
|
}
|
||||||
$res = ($nofirstand ? "" : " AND ")."(".$res.")";
|
$res = ($nofirstand ? "" : " AND ")."(".$res.")";
|
||||||
|
|
||||||
|
|||||||
@@ -2228,6 +2228,8 @@ class EmailCollector extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
dol_syslog("One and only one existing third party has been found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2723,6 +2725,8 @@ class EmailCollector extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$operationslog .= '<br>Project already exists for msgid ='.dol_escape_htmltag($msgid);
|
||||||
}
|
}
|
||||||
} elseif ($operation['type'] == 'ticket') {
|
} elseif ($operation['type'] == 'ticket') {
|
||||||
// Create ticket
|
// Create ticket
|
||||||
|
|||||||
@@ -506,7 +506,6 @@ if ($search_opp_percent) {
|
|||||||
$sql .= dolSqlDateFilter('p.dateo', $search_sday, $search_smonth, $search_syear);
|
$sql .= dolSqlDateFilter('p.dateo', $search_sday, $search_smonth, $search_syear);
|
||||||
$sql .= dolSqlDateFilter('p.datee', $search_eday, $search_emonth, $search_eyear);
|
$sql .= dolSqlDateFilter('p.datee', $search_eday, $search_emonth, $search_eyear);
|
||||||
|
|
||||||
|
|
||||||
if ($search_date_start_start) {
|
if ($search_date_start_start) {
|
||||||
$sql .= " AND p.dateo >= '".$db->idate($search_date_start_start)."'";
|
$sql .= " AND p.dateo >= '".$db->idate($search_date_start_start)."'";
|
||||||
}
|
}
|
||||||
@@ -1469,7 +1468,7 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
// Project url
|
// Project url
|
||||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||||
print '<td class="nowraponall">';
|
print '<td class="nowraponall tdoverflowmax200" title="'.dol_escape_htmltag($object->ref).'">';
|
||||||
print $object->getNomUrl(1, (!empty(GETPOST('search_usage_event_organization', 'int'))?'eventorganization':''));
|
print $object->getNomUrl(1, (!empty(GETPOST('search_usage_event_organization', 'int'))?'eventorganization':''));
|
||||||
if ($object->hasDelay()) {
|
if ($object->hasDelay()) {
|
||||||
print img_warning($langs->trans('Late'));
|
print img_warning($langs->trans('Late'));
|
||||||
|
|||||||
@@ -156,8 +156,6 @@ class Workstation extends CommonObject
|
|||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
$this->fields['ref']['default'] = $this->getNextNumRef();
|
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
|
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
|
||||||
$this->fields['rowid']['visible'] = 0;
|
$this->fields['rowid']['visible'] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,8 +148,6 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*
|
|
||||||
* Put here all code to build page
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
@@ -190,6 +188,9 @@ llxHeader('', $title, $help_url);
|
|||||||
|
|
||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
|
// Set default value of the property ref
|
||||||
|
$object->fields['ref']['default'] = $object->getNextNumRef();
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Workstation")), '', 'object_'.$object->picto);
|
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Workstation")), '', 'object_'.$object->picto);
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ $formresource = new FormResource($db);
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$help_url = 'EN:Module_Workstation';
|
$help_url = 'EN:Module_Workstation';
|
||||||
$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Workstations"));
|
$title = $langs->trans("Workstations");
|
||||||
$morejs = array();
|
$morejs = array();
|
||||||
$morecss = array();
|
$morecss = array();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user