diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php
index 37e8270d449..cfdb09c527e 100644
--- a/htdocs/core/class/canvas.class.php
+++ b/htdocs/core/class/canvas.class.php
@@ -54,12 +54,12 @@ class Canvas
public $control; // Initialized by getCanvas with controller instance
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- * @param string $actiontype Action type ('create', 'view', 'edit', 'list')
- */
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ * @param string $actiontype Action type ('create', 'view', 'edit', 'list')
+ */
public function __construct($db, $actiontype = 'view')
{
$this->db = $db;
diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php
index edbceec50fd..0934d85b3e7 100644
--- a/htdocs/core/class/ccountry.class.php
+++ b/htdocs/core/class/ccountry.class.php
@@ -171,16 +171,16 @@ class Ccountry // extends CommonObject
public function fetch($id, $code = '', $code_iso = '')
{
global $langs;
- $sql = "SELECT";
+ $sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.code,";
$sql.= " t.code_iso,";
$sql.= " t.label,";
$sql.= " t.active";
- $sql.= " FROM ".MAIN_DB_PREFIX."c_country as t";
- if ($id) $sql.= " WHERE t.rowid = ".$id;
- elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'";
- elseif ($code_iso) $sql.= " WHERE t.code_iso = '".$this->db->escape($code_iso)."'";
+ $sql.= " FROM ".MAIN_DB_PREFIX."c_country as t";
+ if ($id) $sql.= " WHERE t.rowid = ".$id;
+ elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'";
+ elseif ($code_iso) $sql.= " WHERE t.code_iso = '".$this->db->escape($code_iso)."'";
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 98a40c73c0b..ec27b83e0a0 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -154,7 +154,7 @@ abstract class CommonInvoice extends CommonObject
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier')
{
// TODO
- return 0;
+ return 0;
}
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php
index 6c6b14ee4e4..83450ee6462 100644
--- a/htdocs/core/class/commonstickergenerator.class.php
+++ b/htdocs/core/class/commonstickergenerator.class.php
@@ -182,16 +182,16 @@ abstract class CommonStickerGenerator
for($i=$x1;$i<=$x2;$i+=$Pointilles+$Pointilles) {
for($j=$i;$j<=($i+$Pointilles);$j++) {
if($j<=($x2-1)) {
- $pdf->Line($j, $y1, $j+1, $y1); // on trace le pointill? du haut, point par point
- $pdf->Line($j, $y2, $j+1, $y2); // on trace le pointill? du bas, point par point
+ $pdf->Line($j, $y1, $j+1, $y1); // on trace le pointill? du haut, point par point
+ $pdf->Line($j, $y2, $j+1, $y2); // on trace le pointill? du bas, point par point
}
}
}
for($i=$y1;$i<=$y2;$i+=$Pointilles+$Pointilles) {
for($j=$i;$j<=($i+$Pointilles);$j++) {
if($j<=($y2-1)) {
- $pdf->Line($x1, $j, $x1, $j+1); // on trace le pointill? du haut, point par point
- $pdf->Line($x2, $j, $x2, $j+1); // on trace le pointill? du bas, point par point
+ $pdf->Line($x1, $j, $x1, $j+1); // on trace le pointill? du haut, point par point
+ $pdf->Line($x2, $j, $x2, $j+1); // on trace le pointill? du bas, point par point
}
}
}
diff --git a/htdocs/core/class/coreobject.class.php b/htdocs/core/class/coreobject.class.php
index 19588333fcb..cc87a791c0d 100644
--- a/htdocs/core/class/coreobject.class.php
+++ b/htdocs/core/class/coreobject.class.php
@@ -392,10 +392,10 @@ class CoreObject extends CommonObject
*/
public function setDate($field, $date)
{
- if (empty($date))
- {
- $this->{$field} = 0;
- }
+ if (empty($date))
+ {
+ $this->{$field} = 0;
+ }
else
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php
index 5048e74b711..c790d89e407 100644
--- a/htdocs/core/class/ctyperesource.class.php
+++ b/htdocs/core/class/ctyperesource.class.php
@@ -252,7 +252,7 @@ class Ctyperesource
$sql .= $this->db->order($sortfield, $sortorder);
}
if (!empty($limit)) {
- $sql .= ' ' . $this->db->plimit($limit, $offset);
+ $sql .= ' ' . $this->db->plimit($limit, $offset);
}
$resql = $this->db->query($sql);
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index cc6172e441a..a0879160727 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -157,7 +157,7 @@ class DolEditor
$fullpage=false;
if (isset($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT))
{
- $disallowAnyContent=empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT); // Only predefined list of html tags are allowed or all
+ $disallowAnyContent=empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT); // Only predefined list of html tags are allowed or all
}
$found=0;
diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php
index 87d367e23f1..6740ecb7bbf 100644
--- a/htdocs/core/class/html.formcontract.class.php
+++ b/htdocs/core/class/html.formcontract.class.php
@@ -76,13 +76,12 @@ class FormContract
if ($socid > 0)
{
// CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
- if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY))
- $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)";
- elseif ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all')
- {
- $sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") ";
+ if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) {
+ $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)";
+ } elseif ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') {
+ $sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") ";
$sql.= " OR c.fk_soc IS NULL)";
- }
+ }
}
if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)";
$sql.= " ORDER BY c.ref ";
diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php
index 92b551db918..b22473ec483 100644
--- a/htdocs/core/class/ldap.class.php
+++ b/htdocs/core/class/ldap.class.php
@@ -1362,12 +1362,12 @@ class Ldap
}
}
- /**
- * UserAccountControl Flgs to more human understandable form...
- *
- * @param string $uacf UACF
- * @return void
- */
+ /**
+ * UserAccountControl Flgs to more human understandable form...
+ *
+ * @param string $uacf UACF
+ * @return void
+ */
public function parseUACF($uacf)
{
//All flags array
@@ -1408,12 +1408,12 @@ class Ldap
return($retval);
}
- /**
- * SamAccountType value to text
- *
- * @param string $samtype SamType
- * @return string Sam string
- */
+ /**
+ * SamAccountType value to text
+ *
+ * @param string $samtype SamType
+ * @return string Sam string
+ */
public function parseSAT($samtype)
{
$stypes = array(
diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php
index 1b9c9225258..5a63ad0efd6 100644
--- a/htdocs/core/class/menubase.class.php
+++ b/htdocs/core/class/menubase.class.php
@@ -137,22 +137,21 @@ class Menubase
// an insert with a forced id.
if (in_array($this->db->type, array('pgsql')))
{
- $sql = "SELECT MAX(rowid) as maxrowid FROM ".MAIN_DB_PREFIX."menu";
- $resqlrowid=$this->db->query($sql);
- if ($resqlrowid)
- {
- $obj=$this->db->fetch_object($resqlrowid);
- $maxrowid=$obj->maxrowid;
+ $sql = "SELECT MAX(rowid) as maxrowid FROM ".MAIN_DB_PREFIX."menu";
+ $resqlrowid=$this->db->query($sql);
+ if ($resqlrowid) {
+ $obj=$this->db->fetch_object($resqlrowid);
+ $maxrowid=$obj->maxrowid;
- // Max rowid can be empty if there is no record yet
- if(empty($maxrowid)) $maxrowid=1;
+ // Max rowid can be empty if there is no record yet
+ if(empty($maxrowid)) $maxrowid=1;
- $sql = "SELECT setval('".MAIN_DB_PREFIX."menu_rowid_seq', ".($maxrowid).")";
- //print $sql; exit;
- $resqlrowidset=$this->db->query($sql);
- if (! $resqlrowidset) dol_print_error($this->db);
- }
- else dol_print_error($this->db);
+ $sql = "SELECT setval('".MAIN_DB_PREFIX."menu_rowid_seq', ".($maxrowid).")";
+ //print $sql; exit;
+ $resqlrowidset=$this->db->query($sql);
+ if (! $resqlrowidset) dol_print_error($this->db);
+ }
+ else dol_print_error($this->db);
}
// Check that entry does not exists yet on key menu_handler-fk_menu-position-url-entity, to avoid errors with postgresql
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index f9482e843c3..3520b5f1c3c 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -571,7 +571,7 @@ class Notify
}
}
else
- {
+ {
dol_syslog("No notification sent for ".$sendto." because email is empty");
}
$i++;
diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php
index c884f4bd7da..e4fe7843d1d 100644
--- a/htdocs/core/class/openid.class.php
+++ b/htdocs/core/class/openid.class.php
@@ -556,8 +556,8 @@ class SimpleOpenID
return false;
}
else
- {
- dol_syslog(get_class($this).'::sendDiscoveryRequestToGetXRDS found endpoint = '.$server);
+ {
+ dol_syslog(get_class($this).'::sendDiscoveryRequestToGetXRDS found endpoint = '.$server);
$this->SetOpenIDServer($server);
return $server;
}
diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php
index 5625bc9c012..7c329940b2d 100644
--- a/htdocs/core/lib/expedition.lib.php
+++ b/htdocs/core/lib/expedition.lib.php
@@ -94,18 +94,18 @@ function expedition_admin_prepare_head()
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
- $head[$h][0] = DOL_URL_ROOT.'/admin/expedition_extrafields.php';
- $head[$h][1] = $langs->trans("ExtraFields");
- $head[$h][2] = 'attributes_shipment';
- $h++;
+ $head[$h][0] = DOL_URL_ROOT.'/admin/expedition_extrafields.php';
+ $head[$h][1] = $langs->trans("ExtraFields");
+ $head[$h][2] = 'attributes_shipment';
+ $h++;
}
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
- $head[$h][0] = DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php';
- $head[$h][1] = $langs->trans("ExtraFieldsLines");
- $head[$h][2] = 'attributeslines_shipment';
- $h++;
+ $head[$h][0] = DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php';
+ $head[$h][1] = $langs->trans("ExtraFieldsLines");
+ $head[$h][2] = 'attributeslines_shipment';
+ $h++;
}
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index a05a62f5957..30eba9867b8 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -832,12 +832,12 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
if (strstr($mask, 'user_extra_'))
{
- $start = "{user_extra_";
- $end = "\}";
- $extra= get_string_between($mask, "user_extra_", "}");
- if(!empty($user->array_options['options_'.$extra])){
- $mask = preg_replace('#('.$start.')(.*?)('.$end.')#si', $user->array_options['options_'.$extra], $mask);
- }
+ $start = "{user_extra_";
+ $end = "\}";
+ $extra= get_string_between($mask, "user_extra_", "}");
+ if (!empty($user->array_options['options_'.$extra])) {
+ $mask = preg_replace('#('.$start.')(.*?)('.$end.')#si', $user->array_options['options_'.$extra], $mask);
+ }
}
$maskwithonlyymcode=$mask;
$maskwithonlyymcode=preg_replace('/\{(0+)([@\+][0-9\-\+\=]+)?([@\+][0-9\-\+\=]+)?\}/i', $maskcounter, $maskwithonlyymcode);
@@ -1645,7 +1645,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0)
//irtoscan.=($dirtoscan?',':'').preg_replace('/[\r\n]+/',',',trim($conf->global->$const));
$dirtoscan= preg_replace('/[\r\n]+/', ',', trim($conf->global->$const));
- $listoffiles=array();
+ $listoffiles=array();
// Now we add models found in directories scanned
$listofdir=explode(',', $dirtoscan);
@@ -1656,8 +1656,8 @@ function getListOfModels($db, $type, $maxfilenamelength = 0)
if (! $tmpdir) { unset($listofdir[$key]); continue; }
if (is_dir($tmpdir))
{
- // all type of template is allowed
- $tmpfiles=dol_dir_list($tmpdir, 'files', 0, '', '', 'name', SORT_ASC, 0);
+ // all type of template is allowed
+ $tmpfiles=dol_dir_list($tmpdir, 'files', 0, '', '', 'name', SORT_ASC, 0);
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles, $tmpfiles);
}
}
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index 0b06d21c95d..004f355a27a 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -137,11 +137,11 @@ function invoice_admin_prepare_head()
$head[$h][2] = 'payment';
$h++;
- if($conf->global->INVOICE_USE_SITUATION){
- $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
- $head[$h][1] = $langs->trans("InvoiceSituation");
- $head[$h][2] = 'situation';
- $h++;
+ if ($conf->global->INVOICE_USE_SITUATION) {
+ $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
+ $head[$h][1] = $langs->trans("InvoiceSituation");
+ $head[$h][2] = 'situation';
+ $h++;
}
// Show more tabs from modules
diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php
index 8c97bbb348f..3ce9d871b7f 100644
--- a/htdocs/core/lib/json.lib.php
+++ b/htdocs/core/lib/json.lib.php
@@ -353,24 +353,24 @@ function utf82utf16($utf8)
{
// oh please oh please oh please oh please oh please
if(function_exists('mb_convert_encoding')) {
- return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
+ return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
}
switch(strlen($utf8)) {
case 1:
- // this case should never be reached, because we are in ASCII range
- // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return $utf8;
+ // this case should never be reached, because we are in ASCII range
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return $utf8;
case 2:
- // return a UTF-16 character from a 2-byte UTF-8 char
- // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return chr(0x07 & (ord($utf8{0}) >> 2)) . chr((0xC0 & (ord($utf8{0}) << 6)) | (0x3F & ord($utf8{1})));
+ // return a UTF-16 character from a 2-byte UTF-8 char
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0x07 & (ord($utf8{0}) >> 2)) . chr((0xC0 & (ord($utf8{0}) << 6)) | (0x3F & ord($utf8{1})));
case 3:
- // return a UTF-16 character from a 3-byte UTF-8 char
- // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return chr((0xF0 & (ord($utf8{0}) << 4)) | (0x0F & (ord($utf8{1}) >> 2))) . chr((0xC0 & (ord($utf8{1}) << 6)) | (0x7F & ord($utf8{2})));
+ // return a UTF-16 character from a 3-byte UTF-8 char
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr((0xF0 & (ord($utf8{0}) << 4)) | (0x0F & (ord($utf8{1}) >> 2))) . chr((0xC0 & (ord($utf8{1}) << 6)) | (0x7F & ord($utf8{2})));
}
// ignoring UTF-32 for now, sorry
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 609201dd0c3..918b5ebb6a3 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1417,8 +1417,8 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
//print '>'.$outputlangs->charset_output.','.$period;
if(!empty($conf->global->ADD_HTML_FORMATING_INTO_DESC_DOC)){
$libelleproduitservice.= ''."__N__ ".$period.'';
- }else{
- $libelleproduitservice.="__N__".$period;
+ } else {
+ $libelleproduitservice.="__N__".$period;
}
//print $libelleproduitservice;
}
@@ -1705,8 +1705,8 @@ function pdf_getlineqty($object, $i, $outputlangs, $hidedetails = 0)
}
if (empty($reshook))
{
- if ($object->lines[$i]->special_code == 3) return '';
- if (empty($hidedetails) || $hidedetails > 1) $result.=$object->lines[$i]->qty;
+ if ($object->lines[$i]->special_code == 3) return '';
+ if (empty($hidedetails) || $hidedetails > 1) $result.=$object->lines[$i]->qty;
}
return $result;
}
@@ -2108,7 +2108,7 @@ function pdf_getLinkedObjects($object, $outputlangs)
{
if ($objecttype == 'facture')
{
- // For invoice, we don't want to have a reference line on document. Image we are using recuring invoice, we will have a line longer than document width.
+ // For invoice, we don't want to have a reference line on document. Image we are using recuring invoice, we will have a line longer than document width.
}
elseif ($objecttype == 'propal' || $objecttype == 'supplier_proposal')
{
diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php
index 9ba505e9eae..f4efd0c0ee9 100644
--- a/htdocs/core/lib/price.lib.php
+++ b/htdocs/core/lib/price.lib.php
@@ -204,15 +204,15 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$localtaxes = array(0,0,0);
$apply_tax = false;
switch($localtax1_type) {
- case '2': // localtax on product or service
- $apply_tax = true;
- break;
- case '4': // localtax on product
- if ($type == 0) $apply_tax = true;
- break;
- case '6': // localtax on service
- if ($type == 1) $apply_tax = true;
- break;
+ case '2': // localtax on product or service
+ $apply_tax = true;
+ break;
+ case '4': // localtax on product
+ if ($type == 0) $apply_tax = true;
+ break;
+ case '6': // localtax on service
+ if ($type == 1) $apply_tax = true;
+ break;
}
if ($uselocaltax1_rate && $apply_tax) {
@@ -299,15 +299,15 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$apply_tax = false;
switch($localtax1_type) {
- case '1': // localtax on product or service
- $apply_tax = true;
- break;
- case '3': // localtax on product
- if ($type == 0) $apply_tax = true;
- break;
- case '5': // localtax on service
- if ($type == 1) $apply_tax = true;
- break;
+ case '1': // localtax on product or service
+ $apply_tax = true;
+ break;
+ case '3': // localtax on product
+ if ($type == 0) $apply_tax = true;
+ break;
+ case '5': // localtax on service
+ if ($type == 1) $apply_tax = true;
+ break;
}
if ($uselocaltax1_rate && $apply_tax) {
$result[14] = price2num(($tot_sans_remise * (1 + ( $localtax1_rate / 100))) - $tot_sans_remise, 'MT'); // amount tax1 for total_ht_without_discount
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 106ce8336a8..0c80b05c9cd 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -1371,7 +1371,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
{
for ($i = 0 ; $i < $numlines ; $i++)
{
- if ($lines[$i]->fk_task_parent) $lineswithoutlevel0[]=$lines[$i];
+ if ($lines[$i]->fk_task_parent) $lineswithoutlevel0[]=$lines[$i];
}
}
@@ -1848,7 +1848,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
$resql = $db->query($sql2);
if ($resql)
{
- $total_task = 0;
+ $total_task = 0;
$total_opp_amount = 0;
$ponderated_opp_amount = 0;
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 0b72fe4645a..a4b96a6b650 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -312,17 +312,26 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
foreach($feature2 as $subfeature)
{
if (empty($user->rights->$feature->$subfeature->creer)
- && empty($user->rights->$feature->$subfeature->write)
- && empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; }
- else { $createok=1; break; } // Break to bypass second test if the first is ok
+ && empty($user->rights->$feature->$subfeature->write)
+ && empty($user->rights->$feature->$subfeature->create)) {
+ $createok=0;
+ $nbko++;
+ } else {
+ $createok=1;
+ // Break to bypass second test if the first is ok
+ break;
+ }
}
}
elseif (! empty($feature)) // This is for permissions on 2 levels ('creer' or 'write')
{
//print '
feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write;
if (empty($user->rights->$feature->creer)
- && empty($user->rights->$feature->write)
- && empty($user->rights->$feature->create)) { $createok=0; $nbko++; }
+ && empty($user->rights->$feature->write)
+ && empty($user->rights->$feature->create)) {
+ $createok=0;
+ $nbko++;
+ }
}
}
diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php
index 5ff41f97495..63e9a2fc9ff 100644
--- a/htdocs/core/lib/ticket.lib.php
+++ b/htdocs/core/lib/ticket.lib.php
@@ -234,7 +234,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
}
if (! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC))
{
- print '' . ($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . '';
+ print '' . ($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . '';
}
print '
';
}
@@ -690,10 +690,10 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out.=$actionstatic->getNomUrl(1, -1).' ';
}
-// if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id)
-// {
-// $out.=''.$langs->trans('Show').'';
-// }
+ //if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id)
+ //{
+ // $out.=''.$langs->trans('Show').'';
+ //}
if ($user->rights->agenda->allactions->create ||
@@ -723,9 +723,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out.="\n";
// Ref
-
- $out.='