@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id; |
55 | 55 | |
56 | 56 | // $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; |
57 | -$showbirthday = 0; // will be hidden here |
|
57 | +$showbirthday = 0; // will be hidden here |
|
58 | 58 | |
59 | 59 | // If not choice done on calendar owner, we filter on user. |
60 | 60 | if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) { |
@@ -991,8 +991,8 @@ discard block |
||
991 | 991 | // We are in a particular day for $username, now we scan all events |
992 | 992 | foreach ($eventarray as $daykey => $notused) { |
993 | 993 | $annee = dol_print_date($daykey, '%Y', 'tzuserrel'); |
994 | - $mois = dol_print_date($daykey, '%m', 'tzuserrel'); |
|
995 | - $jour = dol_print_date($daykey, '%d', 'tzuserrel'); |
|
994 | + $mois = dol_print_date($daykey, '%m', 'tzuserrel'); |
|
995 | + $jour = dol_print_date($daykey, '%d', 'tzuserrel'); |
|
996 | 996 | |
997 | 997 | if ($day == $jour && (int) $month == (int) $mois && $year == $annee) { // Is it the day we are looking for when calling function ? |
998 | 998 | // Scan all event for this date |
@@ -715,12 +715,12 @@ |
||
715 | 715 | } |
716 | 716 | |
717 | 717 | /** |
718 | - * Return clicable link of object (with eventually picto) |
|
719 | - * |
|
720 | - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) |
|
721 | - * @param array $arraydata Array of data |
|
722 | - * @return string HTML Code for Kanban thumb. |
|
723 | - */ |
|
718 | + * Return clicable link of object (with eventually picto) |
|
719 | + * |
|
720 | + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) |
|
721 | + * @param array $arraydata Array of data |
|
722 | + * @return string HTML Code for Kanban thumb. |
|
723 | + */ |
|
724 | 724 | public function getKanbanView($option = '', $arraydata = null) |
725 | 725 | { |
726 | 726 | global $langs; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | //! Numero d'erreur Plage 1024-1279 |
54 | 54 | public $errno; |
55 | 55 | |
56 | - public $type = 'CHQ'; // 'CHQ', 'TRA', ... |
|
56 | + public $type = 'CHQ'; // 'CHQ', 'TRA', ... |
|
57 | 57 | |
58 | 58 | public $amount; |
59 | 59 | public $date_bordereau; |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | if (!empty($conf->global->CHEQUERECEIPTS_ADDON)) { |
411 | 411 | $mybool = false; |
412 | 412 | |
413 | - $file = getDolGlobalString('CHEQUERECEIPTS_ADDON') . ".php"; |
|
413 | + $file = getDolGlobalString('CHEQUERECEIPTS_ADDON').".php"; |
|
414 | 414 | $classname = $conf->global->CHEQUERECEIPTS_ADDON; |
415 | 415 | |
416 | 416 | // Include file with class |
@@ -427,8 +427,8 @@ discard block |
||
427 | 427 | |
428 | 428 | // For compatibility |
429 | 429 | if (!$mybool) { |
430 | - $file = getDolGlobalString('CHEQUERECEIPTS_ADDON') . ".php"; |
|
431 | - $classname = "mod_chequereceipt_" . getDolGlobalString('CHEQUERECEIPTS_ADDON'); |
|
430 | + $file = getDolGlobalString('CHEQUERECEIPTS_ADDON').".php"; |
|
431 | + $classname = "mod_chequereceipt_".getDolGlobalString('CHEQUERECEIPTS_ADDON'); |
|
432 | 432 | $classname = preg_replace('/\-.*$/', '', $classname); |
433 | 433 | // Include file with class |
434 | 434 | foreach ($conf->file->dol_document_root as $dirroot) { |
@@ -715,12 +715,12 @@ |
||
715 | 715 | } |
716 | 716 | |
717 | 717 | /** |
718 | - * Return clicable link of object (with eventually picto) |
|
719 | - * |
|
720 | - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) |
|
721 | - * @param array $arraydata Array of data |
|
722 | - * @return string HTML Code for Kanban thumb. |
|
723 | - */ |
|
718 | + * Return clicable link of object (with eventually picto) |
|
719 | + * |
|
720 | + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) |
|
721 | + * @param array $arraydata Array of data |
|
722 | + * @return string HTML Code for Kanban thumb. |
|
723 | + */ |
|
724 | 724 | public function getKanbanView($option = '', $arraydata = null) |
725 | 725 | { |
726 | 726 | global $langs; |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | public $members = array(); // Array of users |
105 | 105 | |
106 | 106 | public $nb_rights; // Number of rights granted to the user |
107 | - public $nb_users; // Number of users in the group |
|
107 | + public $nb_users; // Number of users in the group |
|
108 | 108 | |
109 | - public $rights; // Permissions of the group |
|
109 | + public $rights; // Permissions of the group |
|
110 | 110 | |
111 | 111 | private $_tab_loaded = array(); // Array of cache of already loaded permissions |
112 | 112 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | if ($result) { |
180 | 180 | if ($load_members) { |
181 | - $this->members = $this->listUsersForGroup(); // This make a lot of subrequests |
|
181 | + $this->members = $this->listUsersForGroup(); // This make a lot of subrequests |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | return 1; |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | $label = $langs->trans("ShowGroup"); |
849 | 849 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1, 1).'"'; |
850 | 850 | } |
851 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
851 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
852 | 852 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
853 | 853 | } |
854 | 854 | |
@@ -895,13 +895,13 @@ discard block |
||
895 | 895 | global $conf; |
896 | 896 | $dn = ''; |
897 | 897 | if ($mode == 0) { |
898 | - $dn = getDolGlobalString('LDAP_KEY_GROUPS') . "=".$info[getDolGlobalString('LDAP_KEY_GROUPS')]."," . getDolGlobalString('LDAP_GROUP_DN'); |
|
898 | + $dn = getDolGlobalString('LDAP_KEY_GROUPS')."=".$info[getDolGlobalString('LDAP_KEY_GROUPS')].",".getDolGlobalString('LDAP_GROUP_DN'); |
|
899 | 899 | } |
900 | 900 | if ($mode == 1) { |
901 | 901 | $dn = $conf->global->LDAP_GROUP_DN; |
902 | 902 | } |
903 | 903 | if ($mode == 2) { |
904 | - $dn = getDolGlobalString('LDAP_KEY_GROUPS') . "=".$info[getDolGlobalString('LDAP_KEY_GROUPS')]; |
|
904 | + $dn = getDolGlobalString('LDAP_KEY_GROUPS')."=".$info[getDolGlobalString('LDAP_KEY_GROUPS')]; |
|
905 | 905 | } |
906 | 906 | return $dn; |
907 | 907 | } |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | |
126 | 126 | |
127 | 127 | $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; |
128 | - $sql.= " SET service = '".$db->escape($oldprovider."-".$newlabel)."'"; |
|
129 | - $sql.= " WHERE service = '".$db->escape($oldprovider."-".$oldlabel)."'"; |
|
128 | + $sql .= " SET service = '".$db->escape($oldprovider."-".$newlabel)."'"; |
|
129 | + $sql .= " WHERE service = '".$db->escape($oldprovider."-".$oldlabel)."'"; |
|
130 | 130 | |
131 | 131 | |
132 | 132 | $resql = $db->query($sql); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | $globalkey = empty($provider) ? $label : $label.'-'.$provider; |
189 | 189 | |
190 | - if (!dolibarr_del_const($db, $globalkey.'_NAME', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_ID', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SECRET', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_URLAUTHORIZE', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SCOPE', $conf->entity)) { |
|
190 | + if (!dolibarr_del_const($db, $globalkey.'_NAME', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_ID', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SECRET', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_URLAUTHORIZE', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SCOPE', $conf->entity)) { |
|
191 | 191 | setEventMessages($langs->trans("ErrorInEntryDeletion"), null, 'errors'); |
192 | 192 | $error++; |
193 | 193 | } else { |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $provider.'_NAME', |
263 | 263 | $provider.'_ID', |
264 | 264 | $provider.'_SECRET', |
265 | - $provider.'_URLAUTHORIZE', // For custom oauth links |
|
265 | + $provider.'_URLAUTHORIZE', // For custom oauth links |
|
266 | 266 | $provider.'_SCOPE' // For custom oauth links |
267 | 267 | ); |
268 | 268 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // $list is defined into oauth.lib.php to the list of supporter OAuth providers. |
282 | 282 | foreach ($listinsetup as $key) { |
283 | 283 | $supported = 0; |
284 | - $keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME |
|
284 | + $keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME |
|
285 | 285 | $keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array); |
286 | 286 | $keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array); |
287 | 287 | if (preg_match('/^.*-/', $keyforsupportedoauth2array)) { |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | $list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed; |
1033 | 1033 | $list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique; |
1034 | 1034 | $list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired; |
1035 | - $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1035 | + $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() |
|
1036 | 1036 | $list[$tab->elementtype][$tab->name]['pos'] = $tab->pos; |
1037 | 1037 | $list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable; |
1038 | 1038 | $list[$tab->elementtype][$tab->name]['perms'] = $tab->perms; |
@@ -1671,7 +1671,7 @@ discard block |
||
1671 | 1671 | $num = $this->db->num_rows($result); |
1672 | 1672 | $min = min($num, ($limit <= 0 ? $num : $limit)); |
1673 | 1673 | for ($i = 0; $i < $min; $i++) { |
1674 | - $type =$this->db->fetch_object($result); |
|
1674 | + $type = $this->db->fetch_object($result); |
|
1675 | 1675 | $this->translateLabel($type, $lang, 'TicketTypeShort', array('ticket')); |
1676 | 1676 | $list[] = $type; |
1677 | 1677 | } |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | $num = $this->db->num_rows($result); |
1735 | 1735 | $min = min($num, ($limit <= 0 ? $num : $limit)); |
1736 | 1736 | for ($i = 0; $i < $min; $i++) { |
1737 | - $type =$this->db->fetch_object($result); |
|
1737 | + $type = $this->db->fetch_object($result); |
|
1738 | 1738 | $list[] = $type; |
1739 | 1739 | } |
1740 | 1740 | } else { |
@@ -1961,13 +1961,13 @@ discard block |
||
1961 | 1961 | throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile); |
1962 | 1962 | } |
1963 | 1963 | } else { |
1964 | - $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php. |
|
1964 | + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php. |
|
1965 | 1965 | |
1966 | 1966 | // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) |
1967 | 1967 | if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { |
1968 | 1968 | $xmlfile = $xmlarray['content']; |
1969 | 1969 | //print "xmlfilestart".$xmlfile."endxmlfile"; |
1970 | - $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); |
|
1970 | + $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET); |
|
1971 | 1971 | } else { |
1972 | 1972 | $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; |
1973 | 1973 | throw new RestException(500, $errormsg); |
@@ -139,7 +139,9 @@ discard block |
||
139 | 139 | $permissiontodelete = $user->rights->hrm->all->delete; |
140 | 140 | |
141 | 141 | // Security check (enable the most restrictive one) |
142 | -if ($user->socid > 0) accessforbidden(); |
|
142 | +if ($user->socid > 0) { |
|
143 | + accessforbidden(); |
|
144 | +} |
|
143 | 145 | //if ($user->socid > 0) accessforbidden(); |
144 | 146 | //$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
145 | 147 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
@@ -147,7 +149,9 @@ discard block |
||
147 | 149 | if (!isModEnabled('hrm')) { |
148 | 150 | accessforbidden('Module hrm not enabled'); |
149 | 151 | } |
150 | -if (!$permissiontoread) accessforbidden(); |
|
152 | +if (!$permissiontoread) { |
|
153 | + accessforbidden(); |
|
154 | +} |
|
151 | 155 | |
152 | 156 | |
153 | 157 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | // Default sort order (if not yet defined by previous GETPOST) |
87 | 87 | if (!$sortfield) { |
88 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
88 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
89 | 89 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
90 | 90 | } |
91 | 91 | if (!$sortorder) { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } |
266 | 266 | } else { |
267 | 267 | if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { |
268 | - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); |
|
268 | + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
|
269 | 269 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
270 | 270 | if (preg_match('/_dtstart$/', $key)) { |
271 | 271 | $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'"; |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
565 | 565 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
566 | 566 | } |
567 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
567 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
568 | 568 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
569 | 569 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; |
570 | 570 | $totalarray['nbfield']++; |
@@ -446,7 +446,7 @@ |
||
446 | 446 | print '<td class="liste_titre right" width="5"> </td>'; |
447 | 447 | print "</tr>\n"; |
448 | 448 | |
449 | - $object->fetch($object->id, '', true); // true to force load of all users, member of the group |
|
449 | + $object->fetch($object->id, '', true); // true to force load of all users, member of the group |
|
450 | 450 | |
451 | 451 | if (!empty($object->members)) { |
452 | 452 | foreach ($object->members as $useringroup) { |
@@ -122,7 +122,7 @@ |
||
122 | 122 | $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) |
123 | 123 | } |
124 | 124 | $sql .= " FROM ".MAIN_DB_PREFIX."projet as t"; |
125 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
125 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
126 | 126 | if ($category > 0) { |
127 | 127 | $sql .= ", ".MAIN_DB_PREFIX."categorie_project as c"; |
128 | 128 | } |
@@ -332,19 +332,19 @@ |
||
332 | 332 | |
333 | 333 | // Export list of tickets and attributes |
334 | 334 | $langs->load("ticket"); |
335 | - $this->export_code[$r]=$this->rights_class.'_'.$r; |
|
336 | - $this->export_label[$r]='ExportDataset_ticket_1'; // Translation key (used only if key ExportDataset_xxx_z not found) |
|
335 | + $this->export_code[$r] = $this->rights_class.'_'.$r; |
|
336 | + $this->export_label[$r] = 'ExportDataset_ticket_1'; // Translation key (used only if key ExportDataset_xxx_z not found) |
|
337 | 337 | $this->export_permission[$r] = array(array("ticket", "export")); |
338 | - $this->export_icon[$r]='ticket'; |
|
339 | - $keyforclass = 'Ticket';$keyforclassfile='/ticket/class/ticket.class.php';$keyforelement='ticket'; |
|
338 | + $this->export_icon[$r] = 'ticket'; |
|
339 | + $keyforclass = 'Ticket'; $keyforclassfile = '/ticket/class/ticket.class.php'; $keyforelement = 'ticket'; |
|
340 | 340 | include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; |
341 | - $keyforselect='ticket'; $keyforaliasextra='extra'; $keyforelement='ticket'; |
|
341 | + $keyforselect = 'ticket'; $keyforaliasextra = 'extra'; $keyforelement = 'ticket'; |
|
342 | 342 | include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; |
343 | - $this->export_sql_start[$r]='SELECT DISTINCT '; |
|
344 | - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'ticket as t'; |
|
343 | + $this->export_sql_start[$r] = 'SELECT DISTINCT '; |
|
344 | + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'ticket as t'; |
|
345 | 345 | $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'ticket_extrafields as extra on (t.rowid = extra.fk_object)'; |
346 | - $this->export_sql_end[$r] .=' WHERE 1 = 1'; |
|
347 | - $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('ticket').')'; |
|
346 | + $this->export_sql_end[$r] .= ' WHERE 1 = 1'; |
|
347 | + $this->export_sql_end[$r] .= ' AND t.entity IN ('.getEntity('ticket').')'; |
|
348 | 348 | $r++; |
349 | 349 | } |
350 | 350 |