@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 3 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // Security: Delete string ../ or ..\ into $original_file |
| 132 | - $original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' |
|
| 132 | + $original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' |
|
| 133 | 133 | $original_file = str_replace('../', '/', $original_file); |
| 134 | 134 | $original_file = str_replace('..\\', '/', $original_file); |
| 135 | 135 | |
@@ -146,13 +146,13 @@ discard block |
||
| 146 | 146 | // check config access |
| 147 | 147 | // and file mime type (only PDF) |
| 148 | 148 | // and check login access |
| 149 | - if (getDolGlobalInt('WEBPORTAL_' . $moduleNameUpperEn . '_LIST_ACCESS') |
|
| 149 | + if (getDolGlobalInt('WEBPORTAL_'.$moduleNameUpperEn.'_LIST_ACCESS') |
|
| 150 | 150 | && in_array($type, array('application/pdf')) |
| 151 | 151 | && ($context->logged_thirdparty && $context->logged_thirdparty->id > 0) |
| 152 | 152 | && $context->logged_thirdparty->id == $socId |
| 153 | 153 | ) { |
| 154 | 154 | if (isModEnabled($moduleName) && isset($conf->{$moduleName}->multidir_output[$entity])) { |
| 155 | - $original_file = $conf->{$moduleName}->multidir_output[$entity] . '/' . $original_file; |
|
| 155 | + $original_file = $conf->{$moduleName}->multidir_output[$entity].'/'.$original_file; |
|
| 156 | 156 | $accessallowed = 1; |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -167,13 +167,13 @@ discard block |
||
| 167 | 167 | // Security: |
| 168 | 168 | // We refuse directory transversal change and pipes in file names |
| 169 | 169 | if (preg_match('/\.\./', $fullpath_original_file) || preg_match('/[<>|]/', $fullpath_original_file)) { |
| 170 | - dol_syslog("Refused to deliver file " . $fullpath_original_file); |
|
| 171 | - print "ErrorFileNameInvalid: " . dol_escape_htmltag($original_file); |
|
| 170 | + dol_syslog("Refused to deliver file ".$fullpath_original_file); |
|
| 171 | + print "ErrorFileNameInvalid: ".dol_escape_htmltag($original_file); |
|
| 172 | 172 | exit; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | // Find the subdirectory name as the reference |
| 176 | - $refname = basename(dirname($original_file) . "/"); |
|
| 176 | + $refname = basename(dirname($original_file)."/"); |
|
| 177 | 177 | |
| 178 | 178 | $filename = basename($fullpath_original_file); |
| 179 | 179 | $filename = preg_replace('/\.noexe$/i', '', $filename); |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | // This test if file exists should be useless. We keep it to find bug more easily |
| 186 | 186 | if (!file_exists($fullpath_original_file_osencoded)) { |
| 187 | - dol_syslog("ErrorFileDoesNotExists: " . $fullpath_original_file); |
|
| 188 | - print "ErrorFileDoesNotExists: " . $original_file; |
|
| 187 | + dol_syslog("ErrorFileDoesNotExists: ".$fullpath_original_file); |
|
| 188 | + print "ErrorFileDoesNotExists: ".$original_file; |
|
| 189 | 189 | exit; |
| 190 | 190 | } |
| 191 | 191 | |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | $fileSizeMaxDefault = 20 * 1024; // 20 Mo by default |
| 194 | 194 | $fileSizeMax = getDolGlobalInt('MAIN_SECURITY_MAXFILESIZE_DOWNLOADED', $fileSizeMaxDefault); |
| 195 | 195 | if ($fileSize > $fileSizeMax) { |
| 196 | - dol_syslog('ErrorFileSizeTooLarge: ' . $fileSize); |
|
| 197 | - print 'ErrorFileSizeTooLarge: ' . $fileSize . ' (max ' . $fileSizeMax . ')'; |
|
| 196 | + dol_syslog('ErrorFileSizeTooLarge: '.$fileSize); |
|
| 197 | + print 'ErrorFileSizeTooLarge: '.$fileSize.' (max '.$fileSizeMax.')'; |
|
| 198 | 198 | exit; |
| 199 | 199 | } |
| 200 | 200 | |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | $object = new stdClass(); |
| 207 | 207 | $reshook = $hookmanager->executeHooks('downloadDocument', $parameters, $object, $action); // Note that $action and $object may have been |
| 208 | 208 | if ($reshook < 0) { |
| 209 | - $errors = $hookmanager->error . (is_array($hookmanager->errors) ? (!empty($hookmanager->error) ? ', ' : '') . implode(', ', $hookmanager->errors) : ''); |
|
| 210 | - dol_syslog("document.php - Errors when executing the hook 'downloadDocument' : " . $errors); |
|
| 211 | - print "ErrorDownloadDocumentHooks: " . $errors; |
|
| 209 | + $errors = $hookmanager->error.(is_array($hookmanager->errors) ? (!empty($hookmanager->error) ? ', ' : '').implode(', ', $hookmanager->errors) : ''); |
|
| 210 | + dol_syslog("document.php - Errors when executing the hook 'downloadDocument' : ".$errors); |
|
| 211 | + print "ErrorDownloadDocumentHooks: ".$errors; |
|
| 212 | 212 | exit; |
| 213 | 213 | } |
| 214 | 214 | |
@@ -286,19 +286,19 @@ discard block |
||
| 286 | 286 | top_httphead($type); |
| 287 | 287 | header('Content-Description: File Transfer'); |
| 288 | 288 | if ($encoding) { |
| 289 | - header('Content-Encoding: ' . $encoding); |
|
| 289 | + header('Content-Encoding: '.$encoding); |
|
| 290 | 290 | } |
| 291 | 291 | // Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open) |
| 292 | 292 | if ($attachment) { |
| 293 | - header('Content-Disposition: attachment; filename="' . $filename . '"'); |
|
| 293 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
| 294 | 294 | } else { |
| 295 | - header('Content-Disposition: inline; filename="' . $filename . '"'); |
|
| 295 | + header('Content-Disposition: inline; filename="'.$filename.'"'); |
|
| 296 | 296 | } |
| 297 | 297 | header('Cache-Control: Public, must-revalidate'); |
| 298 | 298 | header('Pragma: public'); |
| 299 | 299 | |
| 300 | 300 | // Send file now |
| 301 | - header('Content-Length: ' . dol_filesize($fullpath_original_file)); |
|
| 301 | + header('Content-Length: '.dol_filesize($fullpath_original_file)); |
|
| 302 | 302 | readfileLowMemory($fullpath_original_file_osencoded); |
| 303 | 303 | } |
| 304 | 304 | } |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | * \brief File of class with all html predefined components for WebPortal |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 28 | -require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; |
|
| 27 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 28 | +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; |
|
| 29 | 29 | dol_include_once('/webportal/class/html.formwebportal.class.php'); |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // load module libraries |
| 136 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
| 136 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
| 137 | 137 | |
| 138 | 138 | // Initialize technical objects |
| 139 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
| 139 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
| 140 | 140 | $object = new $objectclass($this->db); |
| 141 | 141 | |
| 142 | 142 | // set form list |
@@ -146,18 +146,18 @@ discard block |
||
| 146 | 146 | $this->sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 147 | 147 | $this->sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 148 | 148 | $this->page = GETPOSTISSET('page') ? (int) GETPOST('page', 'int') : 1; |
| 149 | - $this->titleKey = $objectclass . 'ListTitle'; |
|
| 149 | + $this->titleKey = $objectclass.'ListTitle'; |
|
| 150 | 150 | |
| 151 | 151 | // Initialize array of search criteria |
| 152 | 152 | //$search_all = GETPOST('search_all', 'alphanohtml'); |
| 153 | 153 | $search = array(); |
| 154 | 154 | foreach ($object->fields as $key => $val) { |
| 155 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
| 156 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 155 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
| 156 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 157 | 157 | } |
| 158 | 158 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 159 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
| 160 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
| 159 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
| 160 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
| 161 | 161 | // extract date YYYY-MM-DD for year, month and day |
| 162 | 162 | $dateStartArr = explode('-', $postDateStart); |
| 163 | 163 | $dateEndArr = explode('-', $postDateEnd); |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | $dateStartYear = (int) $dateStartArr[0]; |
| 166 | 166 | $dateStartMonth = (int) $dateStartArr[1]; |
| 167 | 167 | $dateStartDay = (int) $dateStartArr[2]; |
| 168 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
| 168 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
| 169 | 169 | } |
| 170 | 170 | if (count($dateEndArr) == 3) { |
| 171 | 171 | $dateEndYear = (int) $dateEndArr[0]; |
| 172 | 172 | $dateEndMonth = (int) $dateEndArr[1]; |
| 173 | 173 | $dateEndDay = (int) $dateEndArr[2]; |
| 174 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
| 174 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | // If $val['visible']==0, then we never show the field |
| 187 | 187 | if (!empty($val['visible'])) { |
| 188 | 188 | $visible = (int) dol_eval($val['visible'], 1); |
| 189 | - $arrayfields['t.' . $key] = array( |
|
| 189 | + $arrayfields['t.'.$key] = array( |
|
| 190 | 190 | 'label' => $val['label'], |
| 191 | 191 | 'checked' => (($visible < 0) ? 0 : 1), |
| 192 | 192 | 'enabled' => (abs($visible) != 3 && dol_eval($val['enabled'], 1)), |
@@ -222,8 +222,8 @@ discard block |
||
| 222 | 222 | foreach ($object->fields as $key => $val) { |
| 223 | 223 | $search[$key] = ''; |
| 224 | 224 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 225 | - $search[$key . '_dtstart'] = ''; |
|
| 226 | - $search[$key . '_dtend'] = ''; |
|
| 225 | + $search[$key.'_dtstart'] = ''; |
|
| 226 | + $search[$key.'_dtend'] = ''; |
|
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | $this->search = $search; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $offset = $limit * ($page - 1); |
| 279 | 279 | if (!$sortfield) { |
| 280 | 280 | reset($object->fields); // Reset is required to avoid key() to return null. |
| 281 | - $sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 281 | + $sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 282 | 282 | } |
| 283 | 283 | if (!$sortorder) { |
| 284 | 284 | $sortorder = 'DESC'; |
@@ -297,18 +297,18 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $sqlfields = $sql; // $sql fields to remove for count total |
| 299 | 299 | |
| 300 | - $sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t"; |
|
| 300 | + $sql .= " FROM ".$this->db->prefix().$object->table_element." as t"; |
|
| 301 | 301 | // Add table from hooks |
| 302 | 302 | $parameters = array(); |
| 303 | 303 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 304 | 304 | $sql .= $hookmanager->resPrint; |
| 305 | 305 | if ($object->ismultientitymanaged == 1) { |
| 306 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)) . ")"; |
|
| 306 | + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; |
|
| 307 | 307 | } else { |
| 308 | 308 | $sql .= " WHERE 1 = 1"; |
| 309 | 309 | } |
| 310 | 310 | // filter on logged third-party |
| 311 | - $sql .= " AND t.fk_soc = " . (int) $context->logged_thirdparty->id; |
|
| 311 | + $sql .= " AND t.fk_soc = ".(int) $context->logged_thirdparty->id; |
|
| 312 | 312 | foreach ($search as $key => $val) { |
| 313 | 313 | if (array_key_exists($key, $object->fields)) { |
| 314 | 314 | if (($key == 'status' || $key == 'fk_statut') && $search[$key] == $emptyValueKey) { |
@@ -322,17 +322,17 @@ discard block |
||
| 322 | 322 | $mode_search = 2; |
| 323 | 323 | } |
| 324 | 324 | if ($search[$key] != '') { |
| 325 | - $sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 325 | + $sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 326 | 326 | } |
| 327 | 327 | } else { |
| 328 | 328 | if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { |
| 329 | 329 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
| 330 | 330 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
| 331 | 331 | if (preg_match('/_dtstart$/', $key)) { |
| 332 | - $sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate($search[$key]) . "'"; |
|
| 332 | + $sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate($search[$key])."'"; |
|
| 333 | 333 | } |
| 334 | 334 | if (preg_match('/_dtend$/', $key)) { |
| 335 | - $sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate($search[$key]) . "'"; |
|
| 335 | + $sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate($search[$key])."'"; |
|
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | } |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | $nbtotalofrecords = 0; |
| 351 | 351 | if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { |
| 352 | 352 | /* The fast and low memory method to get and count full list converts the sql into a sql count */ |
| 353 | - $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 353 | + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 354 | 354 | $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); |
| 355 | 355 | $resql = $this->db->query($sqlforcount); |
| 356 | 356 | if ($resql) { |
@@ -403,21 +403,21 @@ discard block |
||
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | $param = ''; |
| 406 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 407 | - $param .= '&limit=' . $limit; |
|
| 406 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 407 | + $param .= '&limit='.$limit; |
|
| 408 | 408 | foreach ($search as $key => $val) { |
| 409 | 409 | if (is_array($search[$key])) { |
| 410 | 410 | foreach ($search[$key] as $skey) { |
| 411 | 411 | if ($skey != '') { |
| 412 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
| 412 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { |
| 416 | - $param .= '&search_' . $key . 'month=' . ((int) GETPOST('search_' . $key . 'month', 'int')); |
|
| 417 | - $param .= '&search_' . $key . 'day=' . ((int) GETPOST('search_' . $key . 'day', 'int')); |
|
| 418 | - $param .= '&search_' . $key . 'year=' . ((int) GETPOST('search_' . $key . 'year', 'int')); |
|
| 416 | + $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); |
|
| 417 | + $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); |
|
| 418 | + $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); |
|
| 419 | 419 | } elseif ($search[$key] != '') { |
| 420 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
| 420 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
| 421 | 421 | } |
| 422 | 422 | } |
| 423 | 423 | // Add $param from hooks |
@@ -426,29 +426,29 @@ discard block |
||
| 426 | 426 | $param .= $hookmanager->resPrint; |
| 427 | 427 | |
| 428 | 428 | $url_file = $context->getControllerUrl($context->controller); |
| 429 | - $html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n"; |
|
| 429 | + $html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n"; |
|
| 430 | 430 | $html .= $context->getFormToken(); |
| 431 | 431 | $html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 432 | 432 | $html .= '<input type="hidden" name="action" value="list">'; |
| 433 | - $html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 434 | - $html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 435 | - $html .= '<input type="hidden" name="page" value="' . $page . '">'; |
|
| 436 | - $html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
| 433 | + $html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 434 | + $html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 435 | + $html .= '<input type="hidden" name="page" value="'.$page.'">'; |
|
| 436 | + $html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
| 437 | 437 | |
| 438 | 438 | // pagination |
| 439 | - $pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
| 440 | - $html .= '<nav id="webportal-' . $elementEn . '-pagination">'; |
|
| 439 | + $pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
| 440 | + $html .= '<nav id="webportal-'.$elementEn.'-pagination">'; |
|
| 441 | 441 | $html .= '<ul>'; |
| 442 | - $html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>'; |
|
| 442 | + $html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>'; |
|
| 443 | 443 | $html .= '</ul>'; |
| 444 | 444 | |
| 445 | 445 | /* Generate pagination list */ |
| 446 | - $html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page); |
|
| 446 | + $html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page); |
|
| 447 | 447 | |
| 448 | 448 | $html .= '</nav>'; |
| 449 | 449 | |
| 450 | 450 | // table with search filters and column titles |
| 451 | - $html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">'; |
|
| 451 | + $html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">'; |
|
| 452 | 452 | // title and desc for table |
| 453 | 453 | //if ($titleKey != '') { |
| 454 | 454 | // $html .= '<caption id="table-collapse-responsive">'; |
@@ -472,22 +472,22 @@ discard block |
||
| 472 | 472 | $html .= '</td>'; |
| 473 | 473 | // } |
| 474 | 474 | foreach ($object->fields as $key => $val) { |
| 475 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 476 | - $html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 475 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 476 | + $html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 477 | 477 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
| 478 | - $html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 478 | + $html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 479 | 479 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 480 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
| 481 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
| 480 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
| 481 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
| 482 | 482 | |
| 483 | 483 | $html .= '<div class="grid">'; |
| 484 | - $html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 484 | + $html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 485 | 485 | $html .= '</div>'; |
| 486 | 486 | $html .= '<div class="grid">'; |
| 487 | - $html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 487 | + $html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 488 | 488 | $html .= '</div>'; |
| 489 | 489 | } else { |
| 490 | - $html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
| 490 | + $html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
| 491 | 491 | } |
| 492 | 492 | $html .= '</td>'; |
| 493 | 493 | } |
@@ -498,12 +498,12 @@ discard block |
||
| 498 | 498 | $html .= $hookmanager->resPrint; |
| 499 | 499 | // Remain to pay |
| 500 | 500 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 501 | - $html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 501 | + $html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 502 | 502 | $html .= '</td>'; |
| 503 | 503 | } |
| 504 | 504 | // Download link |
| 505 | 505 | if (!empty($arrayfields['download_link']['checked'])) { |
| 506 | - $html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 506 | + $html .= '<td data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 507 | 507 | $html .= '</td>'; |
| 508 | 508 | } |
| 509 | 509 | $html .= '</tr>'; |
@@ -521,16 +521,16 @@ discard block |
||
| 521 | 521 | $totalarray['nbfield']++; |
| 522 | 522 | // } |
| 523 | 523 | foreach ($object->fields as $key => $val) { |
| 524 | - $tableKey = 't.' . $key; |
|
| 524 | + $tableKey = 't.'.$key; |
|
| 525 | 525 | if (!empty($arrayfields[$tableKey]['checked'])) { |
| 526 | 526 | $tableOrder = ''; |
| 527 | 527 | if (array_key_exists($tableKey, $sortList)) { |
| 528 | 528 | $tableOrder = strtolower($sortList[$tableKey]); |
| 529 | 529 | } |
| 530 | - $url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param; |
|
| 531 | - $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>'; |
|
| 532 | - $html .= '<a href="' . $url_param . '">'; |
|
| 533 | - $html .= $langs->trans($arrayfields['t.' . $key]['label']); |
|
| 530 | + $url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param; |
|
| 531 | + $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>'; |
|
| 532 | + $html .= '<a href="'.$url_param.'">'; |
|
| 533 | + $html .= $langs->trans($arrayfields['t.'.$key]['label']); |
|
| 534 | 534 | $html .= '</a>'; |
| 535 | 535 | $html .= '</th>'; |
| 536 | 536 | $totalarray['nbfield']++; |
@@ -539,14 +539,14 @@ discard block |
||
| 539 | 539 | // Remain to pay |
| 540 | 540 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 541 | 541 | $html .= '<th scope="col">'; |
| 542 | - $html .= $langs->trans($arrayfields['remain_to_pay']['label']);; |
|
| 542 | + $html .= $langs->trans($arrayfields['remain_to_pay']['label']); ; |
|
| 543 | 543 | $html .= '</th>'; |
| 544 | 544 | $totalarray['nbfield']++; |
| 545 | 545 | } |
| 546 | 546 | // Download link |
| 547 | 547 | if (!empty($arrayfields['download_link']['checked'])) { |
| 548 | 548 | $html .= '<th scope="col">'; |
| 549 | - $html .= $langs->trans($arrayfields['download_link']['label']);; |
|
| 549 | + $html .= $langs->trans($arrayfields['download_link']['label']); ; |
|
| 550 | 550 | $html .= '</th>'; |
| 551 | 551 | $totalarray['nbfield']++; |
| 552 | 552 | } |
@@ -599,13 +599,13 @@ discard block |
||
| 599 | 599 | $remaintopay = 0; |
| 600 | 600 | } |
| 601 | 601 | if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) { |
| 602 | - $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id); |
|
| 602 | + $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source='.$object->id); |
|
| 603 | 603 | $remaintopay = -$remaincreditnote; |
| 604 | 604 | } |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | // Show line of result |
| 608 | - $html .= '<tr data-rowid="' . $object->id . '">'; |
|
| 608 | + $html .= '<tr data-rowid="'.$object->id.'">'; |
|
| 609 | 609 | // if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 610 | 610 | $html .= '<td class="nowraponall">'; |
| 611 | 611 | $html .= '</td>'; |
@@ -614,8 +614,8 @@ discard block |
||
| 614 | 614 | } |
| 615 | 615 | // } |
| 616 | 616 | foreach ($object->fields as $key => $val) { |
| 617 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 618 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">'; |
|
| 617 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 618 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">'; |
|
| 619 | 619 | if ($key == 'status' || $key == 'fk_statut') { |
| 620 | 620 | if ($elementEn == 'invoice') { |
| 621 | 621 | // specific to get invoice status (depends on payment) |
@@ -636,21 +636,21 @@ discard block |
||
| 636 | 636 | } |
| 637 | 637 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
| 638 | 638 | if (!$i) { |
| 639 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
| 639 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
| 640 | 640 | } |
| 641 | 641 | if (!isset($totalarray['val'])) { |
| 642 | 642 | $totalarray['val'] = array(); |
| 643 | 643 | } |
| 644 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
| 645 | - $totalarray['val']['t.' . $key] = 0; |
|
| 644 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
| 645 | + $totalarray['val']['t.'.$key] = 0; |
|
| 646 | 646 | } |
| 647 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
| 647 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
| 651 | 651 | // Remain to pay |
| 652 | 652 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 653 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 653 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 654 | 654 | $html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, ''); |
| 655 | 655 | //$html .= price($remaintopay); |
| 656 | 656 | $html .= '</td>'; |
@@ -661,9 +661,9 @@ discard block |
||
| 661 | 661 | // Download link |
| 662 | 662 | if (!empty($arrayfields['download_link']['checked'])) { |
| 663 | 663 | $element = $object->element; |
| 664 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 664 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 665 | 665 | $filename = dol_sanitizeFileName($obj->ref); |
| 666 | - $filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref); |
|
| 666 | + $filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref); |
|
| 667 | 667 | $html .= $this->form->getDocumentsLink($element, $filename, $filedir); |
| 668 | 668 | $html .= '</td>'; |
| 669 | 669 | if (!$i) { |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | $html .= '</td>'; |
| 701 | 701 | } else { |
| 702 | 702 | if ($i == 1) { |
| 703 | - $html .= '<td>' . $langs->trans("Total") . '</td>'; |
|
| 703 | + $html .= '<td>'.$langs->trans("Total").'</td>'; |
|
| 704 | 704 | } else { |
| 705 | 705 | $html .= '<td></td>'; |
| 706 | 706 | } |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | $colspan++; |
| 718 | 718 | } |
| 719 | 719 | } |
| 720 | - $html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 720 | + $html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | $html .= '</tbody>'; |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | $html = '<ul class="pages-nav-list">'; |
| 753 | 753 | |
| 754 | 754 | if ($currentPage > 1) { |
| 755 | - $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>'; |
|
| 755 | + $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="'.$url.$pSep.'page='.($currentPage - 1).'" '.($currentPage <= 1 ? ' disabled' : '').'></a></li>'; |
|
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | $maxPaginItem = min($nbPages, 5); |
@@ -760,21 +760,21 @@ discard block |
||
| 760 | 760 | $maxPageNum = min($nbPages, $currentPage + 3); |
| 761 | 761 | |
| 762 | 762 | if ($minPageNum > 1) { |
| 763 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>'; |
|
| 763 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == 1 ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="'.$url.$pSep.'page=1" >1</a></li>'; |
|
| 764 | 764 | $html .= '<li>…</li>'; |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | for ($p = $minPageNum; $p <= $maxPageNum; $p++) { |
| 768 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>'; |
|
| 768 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage === $p ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'" href="'.$url.$pSep.'page='.$p.'">'.$p.'</a></li>'; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | if ($maxPaginItem < $nbPages) { |
| 772 | 772 | $html .= '<li>…</li>'; |
| 773 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>'; |
|
| 773 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == $nbPages ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="'.$url.$pSep.'page='.$nbPages.'">'.$nbPages.'</a></li>'; |
|
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | if ($currentPage < $nbPages) { |
| 777 | - $html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>'; |
|
| 777 | + $html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="'.$url.$pSep.'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>'; |
|
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | $html .= '</ul>'; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * \brief File of class with all html predefined components for WebPortal |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; |
|
| 27 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Class to manage generation of HTML components |
@@ -70,19 +70,19 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $out = ''; |
| 72 | 72 | if ($label != '') { |
| 73 | - $out .= '<label for="' . $id . '">'; |
|
| 73 | + $out .= '<label for="'.$id.'">'; |
|
| 74 | 74 | } |
| 75 | - $out .= '<input type="' . $type . '"'; |
|
| 76 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
| 75 | + $out .= '<input type="'.$type.'"'; |
|
| 76 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 77 | 77 | if ($id != '') { |
| 78 | - $out .= ' id="' . $id . '"'; |
|
| 78 | + $out .= ' id="'.$id.'"'; |
|
| 79 | 79 | } |
| 80 | - $out .= ' name="' . $name . '"'; |
|
| 81 | - $out .= ' value="' . $value . '"'; |
|
| 82 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
| 83 | - $out .= ' />' . $addInputLabel; |
|
| 80 | + $out .= ' name="'.$name.'"'; |
|
| 81 | + $out .= ' value="'.$value.'"'; |
|
| 82 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
| 83 | + $out .= ' />'.$addInputLabel; |
|
| 84 | 84 | if ($label != '') { |
| 85 | - $out .= $label . '</label>'; |
|
| 85 | + $out .= $label.'</label>'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | return $out; |
@@ -106,17 +106,17 @@ discard block |
||
| 106 | 106 | $out .= '<input'; |
| 107 | 107 | if ($placeholder != '' && $value == '') { |
| 108 | 108 | // to show a placeholder on date input |
| 109 | - $out .= ' type="text" placeholder="' . $placeholder . '" onfocus="(this.type=\'date\')"'; |
|
| 109 | + $out .= ' type="text" placeholder="'.$placeholder.'" onfocus="(this.type=\'date\')"'; |
|
| 110 | 110 | } else { |
| 111 | 111 | $out .= ' type="date"'; |
| 112 | 112 | } |
| 113 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
| 113 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 114 | 114 | if ($id != '') { |
| 115 | - $out .= ' id="' . $id . '"'; |
|
| 115 | + $out .= ' id="'.$id.'"'; |
|
| 116 | 116 | } |
| 117 | - $out .= ' name="' . $name . '"'; |
|
| 118 | - $out .= ' value="' . $value . '"'; |
|
| 119 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
| 117 | + $out .= ' name="'.$name.'"'; |
|
| 118 | + $out .= ' value="'.$value.'"'; |
|
| 119 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
| 120 | 120 | |
| 121 | 121 | $out .= '>'; |
| 122 | 122 | |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | $out = ''; |
| 157 | 157 | |
| 158 | 158 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 159 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '"' . ($disabled ? ' disabled="disabled"' : '') . ' class="' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
| 160 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '"' . ($moreparam ? ' ' . $moreparam : ''); |
|
| 161 | - $out .= '>' . "\n"; |
|
| 159 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'"'.($disabled ? ' disabled="disabled"' : '').' class="'.($morecss ? ' '.$morecss : '').'"'; |
|
| 160 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'"'.($moreparam ? ' '.$moreparam : ''); |
|
| 161 | + $out .= '>'."\n"; |
|
| 162 | 162 | |
| 163 | 163 | if ($show_empty) { |
| 164 | 164 | $textforempty = ' '; |
| 165 | 165 | if (!is_numeric($show_empty)) { |
| 166 | 166 | $textforempty = $show_empty; |
| 167 | 167 | } |
| 168 | - $out .= '<option value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 168 | + $out .= '<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | if (is_array($array)) { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if ($key_in_label) { |
| 200 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 200 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 201 | 201 | } else { |
| 202 | 202 | $selectOptionValue = dol_escape_htmltag($maxlen ? dol_trunc($value, $maxlen) : $value); |
| 203 | 203 | if ($value == '' || $value == '-') { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - $out .= '<option value="' . $key . '"'; |
|
| 208 | + $out .= '<option value="'.$key.'"'; |
|
| 209 | 209 | $out .= $disabled; |
| 210 | 210 | if (is_array($id)) { |
| 211 | 211 | if (in_array($key, $id) && !$disabled) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if (is_array($tmpvalue)) { |
| 221 | 221 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
| 222 | 222 | if (preg_match('/^data-/', $keyforvalue)) { |
| 223 | - $out .= ' ' . $keyforvalue . '="' . dol_escape_htmltag($valueforvalue) . '"'; |
|
| 223 | + $out .= ' '.$keyforvalue.'="'.dol_escape_htmltag($valueforvalue).'"'; |
|
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | { |
| 253 | 253 | global $conf; |
| 254 | 254 | |
| 255 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 255 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 256 | 256 | |
| 257 | 257 | $out = ''; |
| 258 | 258 | |
@@ -268,21 +268,21 @@ discard block |
||
| 268 | 268 | // Get object entity |
| 269 | 269 | if (isModEnabled('multicompany')) { |
| 270 | 270 | $regs = array(); |
| 271 | - preg_match('/\/([0-9]+)\/[^\/]+\/' . preg_quote($modulesubdir, '/') . '$/', $filedir, $regs); |
|
| 271 | + preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs); |
|
| 272 | 272 | $entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | // Get list of files starting with name of ref (Note: files with '^ref\.extension' are generated files, files with '^ref-...' are uploaded files) |
| 276 | 276 | if ($allfiles || getDolGlobalString('MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP')) { |
| 277 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/'); |
|
| 277 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/'); |
|
| 278 | 278 | } else { |
| 279 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/') . '\.'; |
|
| 279 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/').'\.'; |
|
| 280 | 280 | } |
| 281 | 281 | $file_list = dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // We also discard .meta and .png preview |
| 282 | 282 | |
| 283 | 283 | //var_dump($file_list); |
| 284 | 284 | // For ajax treatment |
| 285 | - $out .= '<!-- html.formfile::getDocumentsLink -->' . "\n"; |
|
| 285 | + $out .= '<!-- html.formfile::getDocumentsLink -->'."\n"; |
|
| 286 | 286 | if (!empty($file_list)) { |
| 287 | 287 | $out = ''; |
| 288 | 288 | $tmpout = ''; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $i = 0; |
| 293 | 293 | foreach ($file_list as $file) { |
| 294 | 294 | $i++; |
| 295 | - if ($filter && !preg_match('/' . $filter . '/i', $file["name"])) { |
|
| 295 | + if ($filter && !preg_match('/'.$filter.'/i', $file["name"])) { |
|
| 296 | 296 | continue; // Discard this. It does not match provided filter. |
| 297 | 297 | } |
| 298 | 298 | |
@@ -300,11 +300,11 @@ discard block |
||
| 300 | 300 | // Define relative path for download link (depends on module) |
| 301 | 301 | $relativepath = $file["name"]; // Cas general |
| 302 | 302 | if ($modulesubdir) { |
| 303 | - $relativepath = $modulesubdir . "/" . $file["name"]; // Cas propal, facture... |
|
| 303 | + $relativepath = $modulesubdir."/".$file["name"]; // Cas propal, facture... |
|
| 304 | 304 | } |
| 305 | 305 | // Autre cas |
| 306 | 306 | if ($modulepart == 'donation') { |
| 307 | - $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation') . $file["name"]; |
|
| 307 | + $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation').$file["name"]; |
|
| 308 | 308 | } |
| 309 | 309 | if ($modulepart == 'export') { |
| 310 | 310 | $relativepath = $file["name"]; |
@@ -320,8 +320,8 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | // Download |
| 323 | - $url = $context->getControllerUrl('document') . '&modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($relativepath) . '&soc_id=' . $context->logged_thirdparty->id; |
|
| 324 | - $tmpout .= '<a href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="button"'; |
|
| 323 | + $url = $context->getControllerUrl('document').'&modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($relativepath).'&soc_id='.$context->logged_thirdparty->id; |
|
| 324 | + $tmpout .= '<a href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="button"'; |
|
| 325 | 325 | $mime = dol_mimetype($relativepath, '', 0); |
| 326 | 326 | if (preg_match('/text/', $mime)) { |
| 327 | 327 | $tmpout .= ' target="_blank" rel="noopener noreferrer"'; |
@@ -374,9 +374,9 @@ discard block |
||
| 374 | 374 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 375 | 375 | $reg = array(); |
| 376 | 376 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 377 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 377 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 378 | 378 | } |
| 379 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 379 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 380 | 380 | |
| 381 | 381 | $classname = $InfoFieldList[0]; |
| 382 | 382 | $classpath = $InfoFieldList[1]; |
@@ -399,11 +399,11 @@ discard block |
||
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | if (!is_object($objecttmp)) { |
| 402 | - dol_syslog('Error bad setup of type for field ' . implode(',', $InfoFieldList), LOG_WARNING); |
|
| 403 | - return 'Error bad setup of type for field ' . implode(',', $InfoFieldList); |
|
| 402 | + dol_syslog('Error bad setup of type for field '.implode(',', $InfoFieldList), LOG_WARNING); |
|
| 403 | + return 'Error bad setup of type for field '.implode(',', $InfoFieldList); |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - dol_syslog(__METHOD__ . ' filter=' . $filter, LOG_DEBUG); |
|
| 406 | + dol_syslog(__METHOD__.' filter='.$filter, LOG_DEBUG); |
|
| 407 | 407 | $out = ''; |
| 408 | 408 | // Immediate load of table record. |
| 409 | 409 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | if ($prefixforautocompletemode == 'societe') { |
| 440 | 440 | $prefixforautocompletemode = 'company'; |
| 441 | 441 | } |
| 442 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 442 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 443 | 443 | |
| 444 | 444 | if (in_array($objecttmp->element, array('adherent_type'))) { |
| 445 | 445 | $fieldstoshow = 't.libelle'; |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | continue; |
| 452 | 452 | } |
| 453 | 453 | if (!empty($val['showoncombobox'])) { |
| 454 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 454 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | if ($tmpfieldstoshow) { |
@@ -479,11 +479,11 @@ discard block |
||
| 479 | 479 | $num = 0; |
| 480 | 480 | |
| 481 | 481 | // Search data |
| 482 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 482 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 483 | 483 | if (isset($objecttmp->ismultientitymanaged)) { |
| 484 | 484 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 485 | 485 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 486 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 486 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
@@ -502,10 +502,10 @@ discard block |
||
| 502 | 502 | $sql .= " WHERE 1=1"; |
| 503 | 503 | if (isset($objecttmp->ismultientitymanaged)) { |
| 504 | 504 | if ($objecttmp->ismultientitymanaged == 1) { |
| 505 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 505 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 506 | 506 | } |
| 507 | 507 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 508 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 508 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | if ($searchkey != '') { |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | $errormessage = ''; |
| 517 | 517 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 518 | 518 | if ($errormessage) { |
| 519 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 519 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | } |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | $resql = $this->db->query($sql); |
| 527 | 527 | if ($resql) { |
| 528 | 528 | // Construct $out and $outarray |
| 529 | - $out .= '<select id="' . $htmlname . '" class="' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 529 | + $out .= '<select id="'.$htmlname.'" class="'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 530 | 530 | |
| 531 | 531 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 532 | 532 | $textifempty = ' '; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | } |
| 541 | 541 | } |
| 542 | 542 | if ($showempty) { |
| 543 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 543 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | $num = $this->db->num_rows($resql); |
@@ -563,9 +563,9 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | if (empty($outputmode)) { |
| 565 | 565 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 566 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 566 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 567 | 567 | } else { |
| 568 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 568 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 569 | 569 | } |
| 570 | 570 | } else { |
| 571 | 571 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | } |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | - $out .= '</select>' . "\n"; |
|
| 581 | + $out .= '</select>'."\n"; |
|
| 582 | 582 | } else { |
| 583 | 583 | dol_print_error($this->db); |
| 584 | 584 | } |
@@ -615,22 +615,22 @@ discard block |
||
| 615 | 615 | $size = !empty($val['size']) ? $val['size'] : 0; |
| 616 | 616 | // see common object class |
| 617 | 617 | if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 618 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
| 618 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
| 619 | 619 | $type = 'link'; |
| 620 | 620 | } elseif (preg_match('/^(integer|link):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 621 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 621 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 622 | 622 | $type = 'link'; |
| 623 | 623 | } elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) { |
| 624 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
| 624 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
| 625 | 625 | $type = 'link'; |
| 626 | 626 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 627 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
| 627 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
| 628 | 628 | $type = 'sellist'; |
| 629 | 629 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 630 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 630 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 631 | 631 | $type = 'sellist'; |
| 632 | 632 | } elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) { |
| 633 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
| 633 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
| 634 | 634 | $type = 'sellist'; |
| 635 | 635 | } elseif (preg_match('/^varchar\((\d+)\)/', $val['type'], $reg)) { |
| 636 | 636 | $param['options'] = array(); |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | |
| 669 | 669 | if ($computed) { |
| 670 | 670 | if (!preg_match('/^search_/', $keyprefix)) { |
| 671 | - return '<span>' . $langs->trans("AutomaticallyCalculated") . '</span>'; |
|
| 671 | + return '<span>'.$langs->trans("AutomaticallyCalculated").'</span>'; |
|
| 672 | 672 | } else { |
| 673 | 673 | return ''; |
| 674 | 674 | } |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | $morecss = $val['css']; |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | - $htmlName = $keyprefix . $key . $keysuffix; |
|
| 682 | + $htmlName = $keyprefix.$key.$keysuffix; |
|
| 683 | 683 | $htmlId = $htmlName; |
| 684 | 684 | //$moreparam .= (!empty($required) ? ' required' : ''); |
| 685 | 685 | switch ($type) { |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | |
| 700 | 700 | if ($type == 'datetime') { |
| 701 | 701 | //$moreparam .= ' step="1"'; to show seconds |
| 702 | - $out .= ' ' . $this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
| 702 | + $out .= ' '.$this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
| 703 | 703 | } |
| 704 | 704 | break; |
| 705 | 705 | |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | |
| 710 | 710 | case 'text' : |
| 711 | 711 | case 'html' : |
| 712 | - $moreparam .= ($size > 0 ? ' maxlength="' . $size . '"' : ''); |
|
| 712 | + $moreparam .= ($size > 0 ? ' maxlength="'.$size.'"' : ''); |
|
| 713 | 713 | $out = $this->inputType('text', $htmlName, dol_escape_htmltag($value), $htmlId, $morecss, $moreparam); |
| 714 | 714 | break; |
| 715 | 715 | |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | if (!empty($value)) { |
| 730 | 730 | $value = price($value); // $value in memory is a php numeric, we format it into user number format. |
| 731 | 731 | } |
| 732 | - $addInputLabel = ' ' . $langs->getCurrencySymbol($conf->currency); |
|
| 732 | + $addInputLabel = ' '.$langs->getCurrencySymbol($conf->currency); |
|
| 733 | 733 | $out = $this->inputType('text', $htmlName, $value, $htmlId, $morecss, $moreparam, $addInputLabel); |
| 734 | 734 | break; |
| 735 | 735 | |
@@ -746,14 +746,14 @@ discard block |
||
| 746 | 746 | |
| 747 | 747 | case 'radio' : |
| 748 | 748 | foreach ($param['options'] as $keyopt => $valopt) { |
| 749 | - $htmlId = $htmlName . '_' . $keyopt; |
|
| 750 | - $htmlMoreParam = $moreparam . ($value == $keyopt ? ' checked' : ''); |
|
| 751 | - $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt) . '<br>'; |
|
| 749 | + $htmlId = $htmlName.'_'.$keyopt; |
|
| 750 | + $htmlMoreParam = $moreparam.($value == $keyopt ? ' checked' : ''); |
|
| 751 | + $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt).'<br>'; |
|
| 752 | 752 | } |
| 753 | 753 | break; |
| 754 | 754 | |
| 755 | 755 | case 'select' : |
| 756 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . ' >'; |
|
| 756 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').' >'; |
|
| 757 | 757 | if ($default == '' || $notNull != 1) { |
| 758 | 758 | $out .= '<option value="0"> </option>'; |
| 759 | 759 | } |
@@ -764,15 +764,15 @@ discard block |
||
| 764 | 764 | if (strpos($valb, "|") !== false) { |
| 765 | 765 | list($valb, $parent) = explode('|', $valb); |
| 766 | 766 | } |
| 767 | - $out .= '<option value="' . $keyb . '"'; |
|
| 767 | + $out .= '<option value="'.$keyb.'"'; |
|
| 768 | 768 | $out .= (((string) $value == $keyb) ? ' selected' : ''); |
| 769 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 770 | - $out .= '>' . $valb . '</option>'; |
|
| 769 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 770 | + $out .= '>'.$valb.'</option>'; |
|
| 771 | 771 | } |
| 772 | 772 | $out .= '</select>'; |
| 773 | 773 | break; |
| 774 | 774 | case 'sellist' : |
| 775 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . '>'; |
|
| 775 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').'>'; |
|
| 776 | 776 | |
| 777 | 777 | $param_list = array_keys($param['options']); |
| 778 | 778 | $InfoFieldList = explode(":", $param_list[0]); |
@@ -785,18 +785,18 @@ discard block |
||
| 785 | 785 | // 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value |
| 786 | 786 | // 5 : id category type |
| 787 | 787 | // 6 : ids categories list separated by comma for category root |
| 788 | - $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid'); |
|
| 788 | + $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid'); |
|
| 789 | 789 | |
| 790 | 790 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
| 791 | 791 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
| 792 | - $keyList = 'main.' . $InfoFieldList[2] . ' as rowid'; |
|
| 792 | + $keyList = 'main.'.$InfoFieldList[2].' as rowid'; |
|
| 793 | 793 | } else { |
| 794 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 794 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 795 | 795 | } |
| 796 | 796 | } |
| 797 | 797 | if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) { |
| 798 | 798 | list($parentName, $parentField) = explode('|', $InfoFieldList[3]); |
| 799 | - $keyList .= ', ' . $parentField; |
|
| 799 | + $keyList .= ', '.$parentField; |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | $filter_categorie = false; |
@@ -814,8 +814,8 @@ discard block |
||
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | $sqlwhere = ''; |
| 817 | - $sql = "SELECT " . $keyList; |
|
| 818 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
| 817 | + $sql = "SELECT ".$keyList; |
|
| 818 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
| 819 | 819 | if (!empty($InfoFieldList[4])) { |
| 820 | 820 | // can use SELECT request |
| 821 | 821 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -827,24 +827,24 @@ discard block |
||
| 827 | 827 | |
| 828 | 828 | //We have to join on extrafield table |
| 829 | 829 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 830 | - $sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra"; |
|
| 831 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4]; |
|
| 830 | + $sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra"; |
|
| 831 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; |
|
| 832 | 832 | } else { |
| 833 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
| 833 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
| 834 | 834 | } |
| 835 | 835 | } else { |
| 836 | 836 | $sqlwhere .= ' WHERE 1=1'; |
| 837 | 837 | } |
| 838 | 838 | // Some tables may have field, some other not. For the moment we disable it. |
| 839 | 839 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
| 840 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
| 840 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
| 841 | 841 | } |
| 842 | 842 | $sql .= $sqlwhere; |
| 843 | 843 | //print $sql; |
| 844 | 844 | |
| 845 | - $sql .= ' ORDER BY ' . implode(', ', $fields_label); |
|
| 845 | + $sql .= ' ORDER BY '.implode(', ', $fields_label); |
|
| 846 | 846 | |
| 847 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
| 847 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
| 848 | 848 | $resql = $this->db->query($sql); |
| 849 | 849 | if ($resql) { |
| 850 | 850 | $out .= '<option value="0"> </option>'; |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | if (count($fields_label) > 1) { |
| 861 | 861 | $notrans = true; |
| 862 | 862 | foreach ($fields_label as $field_toshow) { |
| 863 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
| 863 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
| 864 | 864 | } |
| 865 | 865 | } else { |
| 866 | 866 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -871,12 +871,12 @@ discard block |
||
| 871 | 871 | foreach ($fields_label as $field_toshow) { |
| 872 | 872 | $translabel = $langs->trans($obj->$field_toshow); |
| 873 | 873 | if ($translabel != $obj->$field_toshow) { |
| 874 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
| 874 | + $labeltoshow = dol_trunc($translabel).' '; |
|
| 875 | 875 | } else { |
| 876 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
| 876 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
| 877 | 877 | } |
| 878 | 878 | } |
| 879 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 879 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 880 | 880 | } else { |
| 881 | 881 | if (!$notrans) { |
| 882 | 882 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -890,34 +890,34 @@ discard block |
||
| 890 | 890 | $labeltoshow = '(not defined)'; |
| 891 | 891 | } |
| 892 | 892 | if ($value == $obj->rowid) { |
| 893 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 893 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 894 | 894 | } |
| 895 | 895 | |
| 896 | 896 | if (!empty($InfoFieldList[3]) && $parentField) { |
| 897 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
| 897 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
| 898 | 898 | $isDependList = 1; |
| 899 | 899 | } |
| 900 | 900 | |
| 901 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 901 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 902 | 902 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
| 903 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 904 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 903 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 904 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 905 | 905 | } |
| 906 | 906 | |
| 907 | 907 | $i++; |
| 908 | 908 | } |
| 909 | 909 | $this->db->free($resql); |
| 910 | 910 | } else { |
| 911 | - $out .= 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
| 911 | + $out .= 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
| 912 | 912 | } |
| 913 | 913 | } else { |
| 914 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 914 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 915 | 915 | $data = $this->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
| 916 | 916 | $out .= '<option value="0"> </option>'; |
| 917 | 917 | foreach ($data as $data_key => $data_value) { |
| 918 | - $out .= '<option value="' . $data_key . '"'; |
|
| 918 | + $out .= '<option value="'.$data_key.'"'; |
|
| 919 | 919 | $out .= ($value == $data_key ? ' selected' : ''); |
| 920 | - $out .= '>' . $data_value . '</option>'; |
|
| 920 | + $out .= '>'.$data_value.'</option>'; |
|
| 921 | 921 | } |
| 922 | 922 | } |
| 923 | 923 | $out .= '</select>'; |
@@ -989,19 +989,19 @@ discard block |
||
| 989 | 989 | } |
| 990 | 990 | if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { |
| 991 | 991 | $type = 'link'; |
| 992 | - $stringforoptions = $reg[1] . ':' . $reg[2]; |
|
| 992 | + $stringforoptions = $reg[1].':'.$reg[2]; |
|
| 993 | 993 | if ($reg[1] == 'User') { |
| 994 | 994 | $stringforoptions .= ':-1'; |
| 995 | 995 | } |
| 996 | 996 | $param['options'] = array($stringforoptions => $stringforoptions); |
| 997 | 997 | } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 998 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 998 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 999 | 999 | $type = 'sellist'; |
| 1000 | 1000 | } elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 1001 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] => 'N'); |
|
| 1001 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N'); |
|
| 1002 | 1002 | $type = 'sellist'; |
| 1003 | 1003 | } elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) { |
| 1004 | - $param['options'] = array($reg[1] . ':' . $reg[2] => 'N'); |
|
| 1004 | + $param['options'] = array($reg[1].':'.$reg[2] => 'N'); |
|
| 1005 | 1005 | $type = 'sellist'; |
| 1006 | 1006 | } elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) { |
| 1007 | 1007 | $param['options'] = array($reg[1] => 'N'); |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | $value = $object->getLibStatut(3); |
| 1038 | 1038 | } elseif ($type == 'date') { |
| 1039 | 1039 | if (!empty($value)) { |
| 1040 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 1040 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 1041 | 1041 | } else { |
| 1042 | 1042 | $value = ''; |
| 1043 | 1043 | } |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | $value = ''; |
| 1049 | 1049 | } |
| 1050 | 1050 | } elseif ($type == 'duration') { |
| 1051 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 1051 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 1052 | 1052 | if (!is_null($value) && $value !== '') { |
| 1053 | 1053 | $value = convertSecondToTime($value, 'allhourmin'); |
| 1054 | 1054 | } |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | if (!empty($value)) { |
| 1062 | 1062 | $checked = ' checked '; |
| 1063 | 1063 | } |
| 1064 | - $value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>'; |
|
| 1064 | + $value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>'; |
|
| 1065 | 1065 | } elseif ($type == 'mail' || $type == 'email') { |
| 1066 | 1066 | $value = dol_print_email($value, 0, 0, 0, 64, 1, 1); |
| 1067 | 1067 | } elseif ($type == 'url') { |
@@ -1085,7 +1085,7 @@ discard block |
||
| 1085 | 1085 | |
| 1086 | 1086 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
| 1087 | 1087 | $selectkey = $InfoFieldList[2]; |
| 1088 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 1088 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1101,20 +1101,20 @@ discard block |
||
| 1101 | 1101 | } |
| 1102 | 1102 | } |
| 1103 | 1103 | |
| 1104 | - $sql = "SELECT " . $keyList; |
|
| 1105 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 1104 | + $sql = "SELECT ".$keyList; |
|
| 1105 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 1106 | 1106 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 1107 | 1107 | $sql .= ' as main'; |
| 1108 | 1108 | } |
| 1109 | 1109 | if ($selectkey == 'rowid' && empty($value)) { |
| 1110 | - $sql .= " WHERE " . $selectkey . " = 0"; |
|
| 1110 | + $sql .= " WHERE ".$selectkey." = 0"; |
|
| 1111 | 1111 | } elseif ($selectkey == 'rowid') { |
| 1112 | - $sql .= " WHERE " . $selectkey . " = " . ((int) $value); |
|
| 1112 | + $sql .= " WHERE ".$selectkey." = ".((int) $value); |
|
| 1113 | 1113 | } else { |
| 1114 | - $sql .= " WHERE " . $selectkey . " = '" . $this->db->escape($value) . "'"; |
|
| 1114 | + $sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'"; |
|
| 1115 | 1115 | } |
| 1116 | 1116 | |
| 1117 | - dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG); |
|
| 1117 | + dol_syslog(__METHOD__.' type=sellist', LOG_DEBUG); |
|
| 1118 | 1118 | $resql = $this->db->query($sql); |
| 1119 | 1119 | if ($resql) { |
| 1120 | 1120 | if ($filter_categorie === false) { |
@@ -1133,9 +1133,9 @@ discard block |
||
| 1133 | 1133 | $translabel = $langs->trans($obj->$field_toshow); |
| 1134 | 1134 | } |
| 1135 | 1135 | if ($translabel != $field_toshow) { |
| 1136 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
| 1136 | + $value .= dol_trunc($translabel, 18).' '; |
|
| 1137 | 1137 | } else { |
| 1138 | - $value .= $obj->$field_toshow . ' '; |
|
| 1138 | + $value .= $obj->$field_toshow.' '; |
|
| 1139 | 1139 | } |
| 1140 | 1140 | } |
| 1141 | 1141 | } else { |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | } |
| 1152 | 1152 | } |
| 1153 | 1153 | } else { |
| 1154 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1154 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1155 | 1155 | |
| 1156 | 1156 | $toprint = array(); |
| 1157 | 1157 | $obj = $this->db->fetch_object($resql); |
@@ -1159,12 +1159,12 @@ discard block |
||
| 1159 | 1159 | $c->fetch($obj->rowid); |
| 1160 | 1160 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1161 | 1161 | foreach ($ways as $way) { |
| 1162 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1162 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1163 | 1163 | } |
| 1164 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1164 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1165 | 1165 | } |
| 1166 | 1166 | } else { |
| 1167 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
| 1167 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
| 1168 | 1168 | } |
| 1169 | 1169 | } elseif ($type == 'radio') { |
| 1170 | 1170 | $value = $param['options'][$value]; |
@@ -1175,11 +1175,11 @@ discard block |
||
| 1175 | 1175 | $toprint = array(); |
| 1176 | 1176 | foreach ($value_arr as $valueval) { |
| 1177 | 1177 | if (!empty($valueval)) { |
| 1178 | - $toprint[] = '<li>' . $param['options'][$valueval] . '</li>'; |
|
| 1178 | + $toprint[] = '<li>'.$param['options'][$valueval].'</li>'; |
|
| 1179 | 1179 | } |
| 1180 | 1180 | } |
| 1181 | 1181 | if (!empty($toprint)) { |
| 1182 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1182 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1183 | 1183 | } |
| 1184 | 1184 | } |
| 1185 | 1185 | } elseif ($type == 'chkbxlst') { |
@@ -1193,7 +1193,7 @@ discard block |
||
| 1193 | 1193 | |
| 1194 | 1194 | if (count($InfoFieldList) >= 3) { |
| 1195 | 1195 | $selectkey = $InfoFieldList[2]; |
| 1196 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 1196 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1209,15 +1209,15 @@ discard block |
||
| 1209 | 1209 | } |
| 1210 | 1210 | } |
| 1211 | 1211 | |
| 1212 | - $sql = "SELECT " . $keyList; |
|
| 1213 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 1212 | + $sql = "SELECT ".$keyList; |
|
| 1213 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 1214 | 1214 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 1215 | 1215 | $sql .= ' as main'; |
| 1216 | 1216 | } |
| 1217 | 1217 | // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; |
| 1218 | 1218 | // $sql.= ' AND entity = '.$conf->entity; |
| 1219 | 1219 | |
| 1220 | - dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG); |
|
| 1220 | + dol_syslog(__METHOD__.' type=chkbxlst', LOG_DEBUG); |
|
| 1221 | 1221 | $resql = $this->db->query($sql); |
| 1222 | 1222 | if ($resql) { |
| 1223 | 1223 | if ($filter_categorie === false) { |
@@ -1234,9 +1234,9 @@ discard block |
||
| 1234 | 1234 | $translabel = $langs->trans($obj->$field_toshow); |
| 1235 | 1235 | } |
| 1236 | 1236 | if ($translabel != $field_toshow) { |
| 1237 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
| 1237 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
| 1238 | 1238 | } else { |
| 1239 | - $toprint[] = '<li>' . $obj->$field_toshow . '</li>'; |
|
| 1239 | + $toprint[] = '<li>'.$obj->$field_toshow.'</li>'; |
|
| 1240 | 1240 | } |
| 1241 | 1241 | } |
| 1242 | 1242 | } else { |
@@ -1245,15 +1245,15 @@ discard block |
||
| 1245 | 1245 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
| 1246 | 1246 | } |
| 1247 | 1247 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
| 1248 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
| 1248 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
| 1249 | 1249 | } else { |
| 1250 | - $toprint[] = '<li>' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
| 1250 | + $toprint[] = '<li>'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
| 1251 | 1251 | } |
| 1252 | 1252 | } |
| 1253 | 1253 | } |
| 1254 | 1254 | } |
| 1255 | 1255 | } else { |
| 1256 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1256 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1257 | 1257 | |
| 1258 | 1258 | $toprint = array(); |
| 1259 | 1259 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -1262,14 +1262,14 @@ discard block |
||
| 1262 | 1262 | $c->fetch($obj->rowid); |
| 1263 | 1263 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1264 | 1264 | foreach ($ways as $way) { |
| 1265 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1265 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1266 | 1266 | } |
| 1267 | 1267 | } |
| 1268 | 1268 | } |
| 1269 | 1269 | } |
| 1270 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1270 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1271 | 1271 | } else { |
| 1272 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
| 1272 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
| 1273 | 1273 | } |
| 1274 | 1274 | } elseif ($type == 'link') { |
| 1275 | 1275 | // only if something to display (perf) |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | } |
| 1297 | 1297 | } |
| 1298 | 1298 | } else { |
| 1299 | - dol_syslog(__METHOD__ . ' Error bad setup of field', LOG_WARNING); |
|
| 1299 | + dol_syslog(__METHOD__.' Error bad setup of field', LOG_WARNING); |
|
| 1300 | 1300 | return 'Error bad setup of field'; |
| 1301 | 1301 | } |
| 1302 | 1302 | } else { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | // Put here all includes required by your class file |
| 26 | -require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 26 | +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Class for WebPortalMember |
@@ -226,11 +226,11 @@ discard block |
||
| 226 | 226 | if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 227 | 227 | return ['optimize' => $langs->trans("WebPortalMember")]; |
| 228 | 228 | } |
| 229 | - $datas['picto'] = img_picto('', $this->picto) . ' <u>' . $langs->trans("WebPortalMember") . '</u>'; |
|
| 229 | + $datas['picto'] = img_picto('', $this->picto).' <u>'.$langs->trans("WebPortalMember").'</u>'; |
|
| 230 | 230 | if (isset($this->status)) { |
| 231 | - $datas['picto'] .= ' ' . $this->getLibStatut(5); |
|
| 231 | + $datas['picto'] .= ' '.$this->getLibStatut(5); |
|
| 232 | 232 | } |
| 233 | - $datas['ref'] .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; |
|
| 233 | + $datas['ref'] .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; |
|
| 234 | 234 | |
| 235 | 235 | return $datas; |
| 236 | 236 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | ]; |
| 272 | 272 | if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { |
| 273 | 273 | $classfortooltip = 'classforajaxtooltip'; |
| 274 | - $dataparams = ' data-params="' . dol_escape_htmltag(json_encode($params)) . '"'; |
|
| 274 | + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; |
|
| 275 | 275 | $label = ''; |
| 276 | 276 | } else { |
| 277 | 277 | $label = implode($this->getTooltipContentArray($params)); |
@@ -294,19 +294,19 @@ discard block |
||
| 294 | 294 | // } |
| 295 | 295 | //} |
| 296 | 296 | |
| 297 | - $linkstart .= '<a href="' . $url . '"'; |
|
| 297 | + $linkstart .= '<a href="'.$url.'"'; |
|
| 298 | 298 | $linkclose = ""; |
| 299 | 299 | if (empty($notooltip)) { |
| 300 | 300 | if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 301 | 301 | $langs->load("users"); |
| 302 | 302 | $label = $langs->trans("ShowUser"); |
| 303 | - $linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; |
|
| 303 | + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
|
| 304 | 304 | } |
| 305 | - $linkclose .= ($label ? ' title="' . dol_escape_htmltag($label, 1) . '"' : ' title="tocomplete"'); |
|
| 306 | - $linkclose .= $dataparams . ' class="' . $classfortooltip . ($morecss ? ' ' . $morecss : '') . '"'; |
|
| 305 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
| 306 | + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | - $linkstart .= $linkclose . '>'; |
|
| 309 | + $linkstart .= $linkclose.'>'; |
|
| 310 | 310 | $linkend = '</a>'; |
| 311 | 311 | |
| 312 | 312 | if ($option === 'nolink') { |
@@ -325,19 +325,19 @@ discard block |
||
| 325 | 325 | } |
| 326 | 326 | // Only picto |
| 327 | 327 | if ($withpictoimg > 0) { |
| 328 | - $picto = '<span class="nopadding' . ($morecss ? ' userimg' . $morecss : '') . '">' . img_object('', 'user', $paddafterimage . ' ' . ($notooltip ? '' : $dataparams), 0, 0, $notooltip ? 0 : 1) . '</span>'; |
|
| 328 | + $picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : $dataparams), 0, 0, $notooltip ? 0 : 1).'</span>'; |
|
| 329 | 329 | } else { |
| 330 | 330 | // Picto must be a photo |
| 331 | - $picto = '<span class="nopadding' . ($morecss ? ' userimg' . $morecss : '') . '"' . ($paddafterimage ? ' ' . $paddafterimage : '') . '>'; |
|
| 332 | - $picto .= Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto' . (($withpictoimg == -3 || $withpictoimg == -4) ? 'small' : ''), 'mini', 0, 1); |
|
| 331 | + $picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'"'.($paddafterimage ? ' '.$paddafterimage : '').'>'; |
|
| 332 | + $picto .= Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.(($withpictoimg == -3 || $withpictoimg == -4) ? 'small' : ''), 'mini', 0, 1); |
|
| 333 | 333 | $picto .= '</span>'; |
| 334 | 334 | } |
| 335 | 335 | $result .= $picto; |
| 336 | 336 | } |
| 337 | 337 | if (($withpictoimg > -2 && $withpictoimg != 2) || $withpictoimg == -4) { |
| 338 | 338 | if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 339 | - $result .= '<span class="nopadding valignmiddle' . ((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled') . |
|
| 340 | - ($morecss ? ' usertext' . $morecss : '') . '">'; |
|
| 339 | + $result .= '<span class="nopadding valignmiddle'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled'). |
|
| 340 | + ($morecss ? ' usertext'.$morecss : '').'">'; |
|
| 341 | 341 | } |
| 342 | 342 | if ($mode == 'login') { |
| 343 | 343 | $result .= dol_trunc($this->login, $maxlen); |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | // } |
| 367 | 367 | //} |
| 368 | 368 | global $action; |
| 369 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 369 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 370 | 370 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 371 | 371 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 372 | 372 | if ($reshook > 0) { |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $outdone = 0; |
| 427 | 427 | $coords = $this->getFullAddress(1, ', ', getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT')); |
| 428 | 428 | if ($coords) { |
| 429 | - $address = dol_print_address($coords, 'address_' . $htmlkey . '_' . $this->id, $this->element, $this->id, 1, ', '); |
|
| 429 | + $address = dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', '); |
|
| 430 | 430 | if ($address) { |
| 431 | 431 | $out .= $address; |
| 432 | 432 | $outdone++; |
@@ -441,13 +441,13 @@ discard block |
||
| 441 | 441 | |
| 442 | 442 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 443 | 443 | if (!is_object($extralanguages)) { |
| 444 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 444 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 445 | 445 | $extralanguages = new ExtraLanguages($this->db); |
| 446 | 446 | } |
| 447 | 447 | $extralanguages->fetch_name_extralanguages($elementforaltlanguage); |
| 448 | 448 | |
| 449 | 449 | if (!empty($extralanguages->attributes[$elementforaltlanguage]['address']) || !empty($extralanguages->attributes[$elementforaltlanguage]['town'])) { |
| 450 | - $out .= "<!-- alternatelanguage for '" . $elementforaltlanguage . "' set to fields '" . implode(',', $extralanguages->attributes[$elementforaltlanguage]) . "' -->\n"; |
|
| 450 | + $out .= "<!-- alternatelanguage for '".$elementforaltlanguage."' set to fields '".implode(',', $extralanguages->attributes[$elementforaltlanguage])."' -->\n"; |
|
| 451 | 451 | $this->fetchValuesForExtraLanguages(); |
| 452 | 452 | if (!is_object($form)) { |
| 453 | 453 | $form = new Form($this->db); |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | $s = picto_from_langcode($extralangcode, 'class="pictoforlang paddingright"'); |
| 459 | 459 | // This also call dol_format_address() |
| 460 | 460 | $coords = $this->getFullAddress(1, ', ', $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT, $extralangcode); |
| 461 | - $htmltext .= $s . dol_print_address($coords, 'address_' . $htmlkey . '_' . $this->id, $this->element, $this->id, 1, ', '); |
|
| 461 | + $htmltext .= $s.dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', '); |
|
| 462 | 462 | } |
| 463 | 463 | $out .= $form->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 464 | 464 | } |
@@ -469,15 +469,15 @@ discard block |
||
| 469 | 469 | if (!in_array($this->country_code, $countriesusingstate) && !getDolGlobalString('MAIN_FORCE_STATE_INTO_ADDRESS') |
| 470 | 470 | && !getDolGlobalString('SOCIETE_DISABLE_STATE') && $this->state) { |
| 471 | 471 | if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 && $this->region) { |
| 472 | - $out .= ($outdone ? ' - ' : '') . $this->region . ' - ' . $this->state; |
|
| 472 | + $out .= ($outdone ? ' - ' : '').$this->region.' - '.$this->state; |
|
| 473 | 473 | } else { |
| 474 | - $out .= ($outdone ? ' - ' : '') . $this->state; |
|
| 474 | + $out .= ($outdone ? ' - ' : '').$this->state; |
|
| 475 | 475 | } |
| 476 | 476 | $outdone++; |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | if ($outdone) { |
| 480 | - $out = '<div class="address inline-block">' . $out . '</div>'; |
|
| 480 | + $out = '<div class="address inline-block">'.$out.'</div>'; |
|
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | if (!empty($this->phone) || !empty($this->phone_pro) || !empty($this->phone_mobile) || !empty($this->phone_perso) || !empty($this->fax) || !empty($this->office_phone) || !empty($this->user_mobile) || !empty($this->office_fax)) { |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | // Load Dolibarr environment |
| 32 | 32 | require '../../main.inc.php'; |
| 33 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 37 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 38 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
| 39 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 40 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 38 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
| 39 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 40 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
|
| 41 | 41 | |
| 42 | 42 | // Load translation files required by the page |
| 43 | 43 | $langsLoad = array('projects', 'bills', 'orders', 'companies'); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | -include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
| 167 | +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
| 168 | 168 | |
| 169 | 169 | // Purge search criteria |
| 170 | 170 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
@@ -354,10 +354,10 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
| 357 | - $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx |
|
| 357 | + $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx |
|
| 358 | 358 | |
| 359 | 359 | if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
| 360 | - $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
| 360 | + $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
| 361 | 361 | |
| 362 | 362 | if ($result < 0) { |
| 363 | 363 | $langs->load("errors"); |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | if (count($tasksarray) > 0) { |
| 378 | 378 | $id = $tasksarray[0]->id; |
| 379 | 379 | } else { |
| 380 | - header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
| 380 | + header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
|
| 381 | 381 | exit; |
| 382 | 382 | } |
| 383 | 383 | } |
@@ -414,9 +414,9 @@ discard block |
||
| 414 | 414 | if (!($projectstatic->thirdparty->id > 0)) { |
| 415 | 415 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
| 416 | 416 | } else { |
| 417 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 418 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 419 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 417 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 418 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 419 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 420 | 420 | |
| 421 | 421 | $tmpinvoice = new Facture($db); |
| 422 | 422 | $tmptimespent = new Task($db); |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | $arrayoftasks = array(); |
| 482 | 482 | foreach ($toselect as $key => $value) { |
| 483 | 483 | // Get userid, timepent |
| 484 | - $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
| 484 | + $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
| 485 | 485 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
| 486 | 486 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
| 487 | 487 | } |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | // Add lines |
| 556 | - $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
| 556 | + $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
| 557 | 557 | if ($lineid < 0) { |
| 558 | 558 | $error++; |
| 559 | 559 | setEventMessages(null, $tmpinvoice->errors, 'errors'); |
@@ -586,16 +586,16 @@ discard block |
||
| 586 | 586 | |
| 587 | 587 | $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
| 588 | 588 | $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
| 589 | - $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
| 589 | + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
|
| 590 | 590 | $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
| 591 | 591 | |
| 592 | 592 | if (!empty($withdetail)) { |
| 593 | 593 | if (!empty($object->timespent_withhour)) { |
| 594 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
| 594 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
|
| 595 | 595 | } else { |
| 596 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
| 596 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
|
| 597 | 597 | } |
| 598 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
| 598 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
| 599 | 599 | } |
| 600 | 600 | $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
| 601 | 601 | $arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | $arrayoftasks = array(); |
| 674 | 674 | foreach ($toselect as $key => $value) { |
| 675 | 675 | // Get userid, timepent |
| 676 | - $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
| 676 | + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
| 677 | 677 | // $object->id is now the task id |
| 678 | 678 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
| 679 | 679 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | // Add lines |
| 750 | 750 | $date_start = ''; |
| 751 | 751 | $date_end = ''; |
| 752 | - $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
| 752 | + $lineName = $ftask->ref.' - '.$ftask->label; |
|
| 753 | 753 | $lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht); |
| 754 | 754 | if ($lineid < 0) { |
| 755 | 755 | $error++; |
@@ -759,8 +759,8 @@ discard block |
||
| 759 | 759 | |
| 760 | 760 | if (!$error) { |
| 761 | 761 | // Update lineid into line of timespent |
| 762 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
|
| 763 | - $sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')'; |
|
| 762 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
| 763 | + $sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')'; |
|
| 764 | 764 | $result = $db->query($sql); |
| 765 | 765 | if (!$result) { |
| 766 | 766 | $error++; |
@@ -798,12 +798,12 @@ discard block |
||
| 798 | 798 | if (!($projectstatic->thirdparty->id > 0)) { |
| 799 | 799 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
| 800 | 800 | } else { |
| 801 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 802 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 803 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 801 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 802 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 803 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 804 | 804 | |
| 805 | 805 | |
| 806 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
| 806 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
| 807 | 807 | $tmpinter = new Fichinter($db); |
| 808 | 808 | $tmptimespent = new Task($db); |
| 809 | 809 | $fuser = new User($db); |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | $tmpinter->socid = $projectstatic->thirdparty->id; |
| 816 | 816 | $tmpinter->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); |
| 817 | 817 | $tmpinter->fk_project = $projectstatic->id; |
| 818 | - $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
| 818 | + $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
| 819 | 819 | |
| 820 | 820 | if ($interToUse) { |
| 821 | 821 | $tmpinter->fetch($interToUse); |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
| 849 | 849 | |
| 850 | 850 | // Add lines |
| 851 | - $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']); |
|
| 851 | + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']); |
|
| 852 | 852 | } |
| 853 | 853 | } |
| 854 | 854 | |
@@ -879,9 +879,9 @@ discard block |
||
| 879 | 879 | //$result = $projectstatic->fetch($object->fk_project); |
| 880 | 880 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
| 881 | 881 | |
| 882 | -$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
| 882 | +$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
| 883 | 883 | if (!empty($withproject)) { |
| 884 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
| 884 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
| 885 | 885 | } |
| 886 | 886 | $help_url = ''; |
| 887 | 887 | |
@@ -930,13 +930,13 @@ discard block |
||
| 930 | 930 | |
| 931 | 931 | $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
| 932 | 932 | if ($search_user) { |
| 933 | - $param .= '&search_user=' . ((int) $search_user); |
|
| 933 | + $param .= '&search_user='.((int) $search_user); |
|
| 934 | 934 | } |
| 935 | 935 | if ($search_month) { |
| 936 | - $param .= '&search_month=' . ((int) $search_month); |
|
| 936 | + $param .= '&search_month='.((int) $search_month); |
|
| 937 | 937 | } |
| 938 | 938 | if ($search_year) { |
| 939 | - $param .= '&search_year=' . ((int) $search_year); |
|
| 939 | + $param .= '&search_year='.((int) $search_year); |
|
| 940 | 940 | } |
| 941 | 941 | |
| 942 | 942 | // Project card |
@@ -948,14 +948,14 @@ discard block |
||
| 948 | 948 | $morehtmlref .= $projectstatic->title; |
| 949 | 949 | // Thirdparty |
| 950 | 950 | if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
| 951 | - $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
| 951 | + $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
| 952 | 952 | } |
| 953 | 953 | $morehtmlref .= '</div>'; |
| 954 | 954 | |
| 955 | 955 | // Define a complementary filter for search of next/prev ref. |
| 956 | 956 | if (!$user->hasRight('projet', 'all', 'lire')) { |
| 957 | 957 | $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
| 958 | - $projectstatic->next_prev_filter = "rowid IN (" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0') . ")"; |
|
| 958 | + $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; |
|
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
@@ -973,25 +973,25 @@ discard block |
||
| 973 | 973 | print '</td>'; |
| 974 | 974 | print '<td>'; |
| 975 | 975 | if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { |
| 976 | - print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
| 976 | + print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
| 977 | 977 | $htmltext = $langs->trans("ProjectFollowOpportunity"); |
| 978 | 978 | print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
| 979 | 979 | print '<br>'; |
| 980 | 980 | } |
| 981 | 981 | if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { |
| 982 | - print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
| 982 | + print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
| 983 | 983 | $htmltext = $langs->trans("ProjectFollowTasks"); |
| 984 | 984 | print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
| 985 | 985 | print '<br>'; |
| 986 | 986 | } |
| 987 | 987 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
| 988 | - print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> '; |
|
| 988 | + print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> '; |
|
| 989 | 989 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
| 990 | 990 | print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
| 991 | 991 | print '<br>'; |
| 992 | 992 | } |
| 993 | 993 | if (isModEnabled('eventorganization')) { |
| 994 | - print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> '; |
|
| 994 | + print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; |
|
| 995 | 995 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
| 996 | 996 | print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
| 997 | 997 | } |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | } |
| 1000 | 1000 | |
| 1001 | 1001 | // Visibility |
| 1002 | - print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
| 1002 | + print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
| 1003 | 1003 | if ($projectstatic->public) { |
| 1004 | 1004 | print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
| 1005 | 1005 | print $langs->trans('SharedProject'); |
@@ -1010,14 +1010,14 @@ discard block |
||
| 1010 | 1010 | print '</td></tr>'; |
| 1011 | 1011 | |
| 1012 | 1012 | // Budget |
| 1013 | - print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
| 1013 | + print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
| 1014 | 1014 | if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
| 1015 | - print '<span class="amount">' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
| 1015 | + print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
| 1016 | 1016 | } |
| 1017 | 1017 | print '</td></tr>'; |
| 1018 | 1018 | |
| 1019 | 1019 | // Date start - end project |
| 1020 | - print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
| 1020 | + print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
| 1021 | 1021 | $start = dol_print_date($projectstatic->date_start, 'day'); |
| 1022 | 1022 | print($start ? $start : '?'); |
| 1023 | 1023 | $end = dol_print_date($projectstatic->date_end, 'day'); |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | $cols = 2; |
| 1033 | 1033 | $savobject = $object; |
| 1034 | 1034 | $object = $projectstatic; |
| 1035 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 1035 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 1036 | 1036 | $object = $savobject; |
| 1037 | 1037 | |
| 1038 | 1038 | print '</table>'; |
@@ -1050,7 +1050,7 @@ discard block |
||
| 1050 | 1050 | |
| 1051 | 1051 | // Categories |
| 1052 | 1052 | if (isModEnabled('categorie')) { |
| 1053 | - print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
| 1053 | + print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
| 1054 | 1054 | print $form->showCategories($projectstatic->id, 'project', 1); |
| 1055 | 1055 | print "</td></tr>"; |
| 1056 | 1056 | } |
@@ -1079,12 +1079,12 @@ discard block |
||
| 1079 | 1079 | |
| 1080 | 1080 | if (!empty($projectidforalltimes)) { |
| 1081 | 1081 | // We are on tab 'Time Spent' of project |
| 1082 | - $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
| 1083 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
| 1082 | + $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
| 1083 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
| 1084 | 1084 | } else { |
| 1085 | 1085 | // We are on tab 'Time Spent' of task |
| 1086 | - $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
| 1087 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
| 1086 | + $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
| 1087 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
| 1088 | 1088 | } |
| 1089 | 1089 | } else { |
| 1090 | 1090 | $linktocreatetimeBtnStatus = -2; |
@@ -1129,19 +1129,19 @@ discard block |
||
| 1129 | 1129 | print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
| 1130 | 1130 | |
| 1131 | 1131 | if ($action == 'deleteline') { |
| 1132 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : ''); |
|
| 1132 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''); |
|
| 1133 | 1133 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | 1136 | $param = ($withproject ? '&withproject=1' : ''); |
| 1137 | - $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
|
| 1138 | - $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
| 1137 | + $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
| 1138 | + $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
|
| 1139 | 1139 | |
| 1140 | 1140 | if (!GETPOST('withproject') || empty($projectstatic->id)) { |
| 1141 | 1141 | $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
| 1142 | - $object->next_prev_filter = "fk_projet IN (" . $db->sanitize($projectsListId) . ")"; |
|
| 1142 | + $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")"; |
|
| 1143 | 1143 | } else { |
| 1144 | - $object->next_prev_filter = "fk_projet = " . ((int) $projectstatic->id); |
|
| 1144 | + $object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id); |
|
| 1145 | 1145 | } |
| 1146 | 1146 | |
| 1147 | 1147 | $morehtmlref = ''; |
@@ -1149,12 +1149,12 @@ discard block |
||
| 1149 | 1149 | // Project |
| 1150 | 1150 | if (empty($withproject)) { |
| 1151 | 1151 | $morehtmlref .= '<div class="refidno">'; |
| 1152 | - $morehtmlref .= $langs->trans("Project") . ': '; |
|
| 1152 | + $morehtmlref .= $langs->trans("Project").': '; |
|
| 1153 | 1153 | $morehtmlref .= $projectstatic->getNomUrl(1); |
| 1154 | 1154 | $morehtmlref .= '<br>'; |
| 1155 | 1155 | |
| 1156 | 1156 | // Third party |
| 1157 | - $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
| 1157 | + $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
| 1158 | 1158 | if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
| 1159 | 1159 | $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
| 1160 | 1160 | } |
@@ -1170,7 +1170,7 @@ discard block |
||
| 1170 | 1170 | print '<table class="border centpercent tableforfield">'; |
| 1171 | 1171 | |
| 1172 | 1172 | // Task parent |
| 1173 | - print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
| 1173 | + print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
|
| 1174 | 1174 | if ($object->fk_task_parent > 0) { |
| 1175 | 1175 | $tasktmp = new Task($db); |
| 1176 | 1176 | $tasktmp->fetch($object->fk_task_parent); |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | print '</td></tr>'; |
| 1180 | 1180 | |
| 1181 | 1181 | // Date start - Date end task |
| 1182 | - print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
| 1182 | + print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
| 1183 | 1183 | $start = dol_print_date($object->date_start, 'dayhour'); |
| 1184 | 1184 | print($start ? $start : '?'); |
| 1185 | 1185 | $end = dol_print_date($object->date_end, 'dayhour'); |
@@ -1191,7 +1191,7 @@ discard block |
||
| 1191 | 1191 | print '</td></tr>'; |
| 1192 | 1192 | |
| 1193 | 1193 | // Planned workload |
| 1194 | - print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
| 1194 | + print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
| 1195 | 1195 | if ($object->planned_workload) { |
| 1196 | 1196 | print convertSecondToTime($object->planned_workload, 'allhourmin'); |
| 1197 | 1197 | } |
@@ -1206,21 +1206,21 @@ discard block |
||
| 1206 | 1206 | print '<table class="border tableforfield centpercent">'; |
| 1207 | 1207 | |
| 1208 | 1208 | // Progress declared |
| 1209 | - print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
| 1210 | - print $object->progress != '' ? $object->progress . ' %' : ''; |
|
| 1209 | + print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
| 1210 | + print $object->progress != '' ? $object->progress.' %' : ''; |
|
| 1211 | 1211 | print '</td></tr>'; |
| 1212 | 1212 | |
| 1213 | 1213 | // Progress calculated |
| 1214 | - print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
| 1214 | + print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
| 1215 | 1215 | if ($object->planned_workload) { |
| 1216 | 1216 | $tmparray = $object->getSummaryOfTimeSpent(); |
| 1217 | 1217 | if ($tmparray['total_duration'] > 0) { |
| 1218 | - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
| 1218 | + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
| 1219 | 1219 | } else { |
| 1220 | 1220 | print '0 %'; |
| 1221 | 1221 | } |
| 1222 | 1222 | } else { |
| 1223 | - print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
| 1223 | + print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
| 1224 | 1224 | } |
| 1225 | 1225 | print '</td>'; |
| 1226 | 1226 | |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | print dol_get_fiche_end(); |
| 1237 | 1237 | } else { |
| 1238 | 1238 | if ($action == 'deleteline') { |
| 1239 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : ''); |
|
| 1239 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''); |
|
| 1240 | 1240 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
| 1241 | 1241 | } |
| 1242 | 1242 | } |
@@ -1250,7 +1250,7 @@ discard block |
||
| 1250 | 1250 | |
| 1251 | 1251 | if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
| 1252 | 1252 | // We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
| 1253 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOST('lineid', 'int') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage); |
|
| 1253 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOST('lineid', 'int').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage); |
|
| 1254 | 1254 | $formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
| 1255 | 1255 | } |
| 1256 | 1256 | |
@@ -1269,10 +1269,10 @@ discard block |
||
| 1269 | 1269 | // Definition of fields for list |
| 1270 | 1270 | $arrayfields = array(); |
| 1271 | 1271 | $arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1); |
| 1272 | - $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1); |
|
| 1272 | + $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1', 'checked'=>1); |
|
| 1273 | 1273 | $arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1'); |
| 1274 | 1274 | if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
| 1275 | - if (! empty($allprojectforuser)) { |
|
| 1275 | + if (!empty($allprojectforuser)) { |
|
| 1276 | 1276 | $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; |
| 1277 | 1277 | $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; |
| 1278 | 1278 | } |
@@ -1288,82 +1288,82 @@ discard block |
||
| 1288 | 1288 | $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries")); |
| 1289 | 1289 | $arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); |
| 1290 | 1290 | // Extra fields |
| 1291 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 1291 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 1292 | 1292 | |
| 1293 | 1293 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
| 1294 | 1294 | |
| 1295 | 1295 | $param = ''; |
| 1296 | 1296 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
| 1297 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 1297 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 1298 | 1298 | } |
| 1299 | 1299 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 1300 | 1300 | $param .= '&limit='.((int) $limit); |
| 1301 | 1301 | } |
| 1302 | 1302 | if ($search_month > 0) { |
| 1303 | - $param .= '&search_month=' . urlencode($search_month); |
|
| 1303 | + $param .= '&search_month='.urlencode($search_month); |
|
| 1304 | 1304 | } |
| 1305 | 1305 | if ($search_year > 0) { |
| 1306 | - $param .= '&search_year=' . urlencode($search_year); |
|
| 1306 | + $param .= '&search_year='.urlencode($search_year); |
|
| 1307 | 1307 | } |
| 1308 | 1308 | if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
| 1309 | 1309 | $param .= '&search_user='.urlencode($search_user); |
| 1310 | 1310 | } |
| 1311 | 1311 | if ($search_task_ref != '') { |
| 1312 | - $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
| 1312 | + $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
| 1313 | 1313 | } |
| 1314 | 1314 | if ($search_company != '') { |
| 1315 | - $param .= '&$search_company=' . urlencode($search_company); |
|
| 1315 | + $param .= '&$search_company='.urlencode($search_company); |
|
| 1316 | 1316 | } |
| 1317 | 1317 | if ($search_company_alias != '') { |
| 1318 | - $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
| 1318 | + $param .= '&$search_company_alias='.urlencode($search_company_alias); |
|
| 1319 | 1319 | } |
| 1320 | 1320 | if ($search_project_ref != '') { |
| 1321 | - $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
| 1321 | + $param .= '&$search_project_ref='.urlencode($search_project_ref); |
|
| 1322 | 1322 | } |
| 1323 | 1323 | if ($search_project_label != '') { |
| 1324 | - $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
| 1324 | + $param .= '&$search_project_label='.urlencode($search_project_label); |
|
| 1325 | 1325 | } |
| 1326 | 1326 | if ($search_task_label != '') { |
| 1327 | - $param .= '&search_task_label=' . urlencode($search_task_label); |
|
| 1327 | + $param .= '&search_task_label='.urlencode($search_task_label); |
|
| 1328 | 1328 | } |
| 1329 | 1329 | if ($search_note != '') { |
| 1330 | - $param .= '&search_note=' . urlencode($search_note); |
|
| 1330 | + $param .= '&search_note='.urlencode($search_note); |
|
| 1331 | 1331 | } |
| 1332 | 1332 | if ($search_duration != '') { |
| 1333 | - $param .= '&search_field2=' . urlencode($search_duration); |
|
| 1333 | + $param .= '&search_field2='.urlencode($search_duration); |
|
| 1334 | 1334 | } |
| 1335 | 1335 | if ($optioncss != '') { |
| 1336 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
| 1336 | + $param .= '&optioncss='.urlencode($optioncss); |
|
| 1337 | 1337 | } |
| 1338 | 1338 | if ($search_date_startday) { |
| 1339 | - $param .= '&search_date_startday=' . urlencode($search_date_startday); |
|
| 1339 | + $param .= '&search_date_startday='.urlencode($search_date_startday); |
|
| 1340 | 1340 | } |
| 1341 | 1341 | if ($search_date_startmonth) { |
| 1342 | - $param .= '&search_date_startmonth=' . urlencode($search_date_startmonth); |
|
| 1342 | + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); |
|
| 1343 | 1343 | } |
| 1344 | 1344 | if ($search_date_startyear) { |
| 1345 | - $param .= '&search_date_startyear=' . urlencode($search_date_startyear); |
|
| 1345 | + $param .= '&search_date_startyear='.urlencode($search_date_startyear); |
|
| 1346 | 1346 | } |
| 1347 | 1347 | if ($search_date_endday) { |
| 1348 | - $param .= '&search_date_endday=' . urlencode($search_date_endday); |
|
| 1348 | + $param .= '&search_date_endday='.urlencode($search_date_endday); |
|
| 1349 | 1349 | } |
| 1350 | 1350 | if ($search_date_endmonth) { |
| 1351 | - $param .= '&search_date_endmonth=' . urlencode($search_date_endmonth); |
|
| 1351 | + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); |
|
| 1352 | 1352 | } |
| 1353 | 1353 | if ($search_date_endyear) { |
| 1354 | - $param .= '&search_date_endyear=' . urlencode($search_date_endyear); |
|
| 1354 | + $param .= '&search_date_endyear='.urlencode($search_date_endyear); |
|
| 1355 | 1355 | } |
| 1356 | 1356 | if ($search_timespent_starthour) { |
| 1357 | - $param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour); |
|
| 1357 | + $param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour); |
|
| 1358 | 1358 | } |
| 1359 | 1359 | if ($search_timespent_startmin) { |
| 1360 | - $param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin); |
|
| 1360 | + $param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin); |
|
| 1361 | 1361 | } |
| 1362 | 1362 | if ($search_timespent_endhour) { |
| 1363 | - $param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour); |
|
| 1363 | + $param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour); |
|
| 1364 | 1364 | } |
| 1365 | 1365 | if ($search_timespent_endmin) { |
| 1366 | - $param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin); |
|
| 1366 | + $param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin); |
|
| 1367 | 1367 | } |
| 1368 | 1368 | |
| 1369 | 1369 | /* |
@@ -1371,24 +1371,24 @@ discard block |
||
| 1371 | 1371 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
| 1372 | 1372 | */ |
| 1373 | 1373 | if ($id) { |
| 1374 | - $param .= '&id=' . urlencode($id); |
|
| 1374 | + $param .= '&id='.urlencode($id); |
|
| 1375 | 1375 | } |
| 1376 | 1376 | if ($projectid) { |
| 1377 | - $param .= '&projectid=' . urlencode($projectid); |
|
| 1377 | + $param .= '&projectid='.urlencode($projectid); |
|
| 1378 | 1378 | } |
| 1379 | 1379 | if ($withproject) { |
| 1380 | - $param .= '&withproject=' . urlencode($withproject); |
|
| 1380 | + $param .= '&withproject='.urlencode($withproject); |
|
| 1381 | 1381 | } |
| 1382 | 1382 | // Add $param from hooks |
| 1383 | 1383 | $parameters = array(); |
| 1384 | 1384 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
| 1385 | 1385 | $param .= $hookmanager->resPrint; |
| 1386 | 1386 | |
| 1387 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 1387 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 1388 | 1388 | if ($optioncss != '') { |
| 1389 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
| 1389 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
| 1390 | 1390 | } |
| 1391 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1391 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1392 | 1392 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 1393 | 1393 | if ($action == 'editline') { |
| 1394 | 1394 | print '<input type="hidden" name="action" value="updateline">'; |
@@ -1403,13 +1403,13 @@ discard block |
||
| 1403 | 1403 | } else { |
| 1404 | 1404 | print '<input type="hidden" name="action" value="list">'; |
| 1405 | 1405 | } |
| 1406 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 1407 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 1406 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 1407 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 1408 | 1408 | |
| 1409 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
| 1410 | - print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
| 1411 | - print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
| 1412 | - print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
| 1409 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
| 1410 | + print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
| 1411 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
| 1412 | + print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
| 1413 | 1413 | print '<input type="hidden" name="page_y" value="">'; |
| 1414 | 1414 | |
| 1415 | 1415 | // Form to convert time spent into invoice |
@@ -1436,7 +1436,7 @@ discard block |
||
| 1436 | 1436 | 'onelineperperiod' => 'OneLinePerTimeSpentLine', |
| 1437 | 1437 | ); |
| 1438 | 1438 | print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
| 1439 | - print "\n" . '<script type="text/javascript">'; |
|
| 1439 | + print "\n".'<script type="text/javascript">'; |
|
| 1440 | 1440 | print ' |
| 1441 | 1441 | $(document).ready(function () { |
| 1442 | 1442 | setDetailVisibility(); |
@@ -1453,8 +1453,8 @@ discard block |
||
| 1453 | 1453 | } |
| 1454 | 1454 | }); |
| 1455 | 1455 | '; |
| 1456 | - print '</script>' . "\n"; |
|
| 1457 | - print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
| 1456 | + print '</script>'."\n"; |
|
| 1457 | + print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
| 1458 | 1458 | print '</td>'; |
| 1459 | 1459 | print '</tr>'; |
| 1460 | 1460 | |
@@ -1489,14 +1489,14 @@ discard block |
||
| 1489 | 1489 | |
| 1490 | 1490 | print '<br>'; |
| 1491 | 1491 | print '<div class="center">'; |
| 1492 | - print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
| 1493 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 1492 | + print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
| 1493 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 1494 | 1494 | print '</div>'; |
| 1495 | 1495 | print '<br>'; |
| 1496 | 1496 | } else { |
| 1497 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
| 1497 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
| 1498 | 1498 | print '<div class="center">'; |
| 1499 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 1499 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 1500 | 1500 | print '</div>'; |
| 1501 | 1501 | $massaction = ''; |
| 1502 | 1502 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | print '<table class="noborder centpercent">'; |
| 1510 | 1510 | print '<tr>'; |
| 1511 | 1511 | print '<td class="titlefield">'; |
| 1512 | - print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
| 1512 | + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
| 1513 | 1513 | print '</td>'; |
| 1514 | 1514 | print '<td>'; |
| 1515 | 1515 | $forminter = new FormIntervention($db); |
@@ -1519,14 +1519,14 @@ discard block |
||
| 1519 | 1519 | print '</table>'; |
| 1520 | 1520 | |
| 1521 | 1521 | print '<div class="center">'; |
| 1522 | - print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
| 1523 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
| 1522 | + print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
| 1523 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
| 1524 | 1524 | print '</div>'; |
| 1525 | 1525 | print '<br>'; |
| 1526 | 1526 | } else { |
| 1527 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
| 1527 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
| 1528 | 1528 | print '<div class="center">'; |
| 1529 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
| 1529 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
| 1530 | 1530 | print '</div>'; |
| 1531 | 1531 | $massaction = ''; |
| 1532 | 1532 | } |
@@ -1588,14 +1588,14 @@ discard block |
||
| 1588 | 1588 | $sql .= " AND t.fk_element =".((int) $object->id); |
| 1589 | 1589 | } elseif (!empty($projectidforalltimes)) { |
| 1590 | 1590 | // Limit on one project |
| 1591 | - $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; |
|
| 1591 | + $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; |
|
| 1592 | 1592 | } elseif (!empty($allprojectforuser)) { |
| 1593 | 1593 | // Limit on on user |
| 1594 | 1594 | if (empty($search_user)) { |
| 1595 | 1595 | $search_user = $user->id; |
| 1596 | 1596 | } |
| 1597 | 1597 | if ($search_user > 0) { |
| 1598 | - $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
| 1598 | + $sql .= " AND t.fk_user = ".((int) $search_user); |
|
| 1599 | 1599 | } |
| 1600 | 1600 | } |
| 1601 | 1601 | |
@@ -1648,13 +1648,13 @@ discard block |
||
| 1648 | 1648 | if ($search_timespent_starthour || $search_timespent_startmin) { |
| 1649 | 1649 | $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
| 1650 | 1650 | $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
| 1651 | - $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
| 1651 | + $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
| 1652 | 1652 | } |
| 1653 | 1653 | |
| 1654 | 1654 | if ($search_timespent_endhour || $search_timespent_endmin) { |
| 1655 | 1655 | $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
| 1656 | 1656 | $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
| 1657 | - $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
| 1657 | + $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
| 1658 | 1658 | } |
| 1659 | 1659 | } |
| 1660 | 1660 | |
@@ -1702,13 +1702,13 @@ discard block |
||
| 1702 | 1702 | |
| 1703 | 1703 | if ($num >= 0) { |
| 1704 | 1704 | if (!empty($projectidforalltimes)) { |
| 1705 | - print '<!-- List of time spent for project -->' . "\n"; |
|
| 1705 | + print '<!-- List of time spent for project -->'."\n"; |
|
| 1706 | 1706 | |
| 1707 | 1707 | $title = $langs->trans("ListTaskTimeUserProject"); |
| 1708 | 1708 | |
| 1709 | 1709 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
| 1710 | 1710 | } else { |
| 1711 | - print '<!-- List of time spent -->' . "\n"; |
|
| 1711 | + print '<!-- List of time spent -->'."\n"; |
|
| 1712 | 1712 | |
| 1713 | 1713 | $title = $langs->trans("ListTaskTimeForTask"); |
| 1714 | 1714 | |
@@ -1730,26 +1730,26 @@ discard block |
||
| 1730 | 1730 | * Form to add a new line of time spent |
| 1731 | 1731 | */ |
| 1732 | 1732 | if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
| 1733 | - print '<!-- table to add time spent -->' . "\n"; |
|
| 1733 | + print '<!-- table to add time spent -->'."\n"; |
|
| 1734 | 1734 | if (!empty($id)) { |
| 1735 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
| 1735 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
| 1736 | 1736 | } |
| 1737 | 1737 | |
| 1738 | 1738 | print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
| 1739 | 1739 | print '<table class="noborder nohover centpercent">'; |
| 1740 | 1740 | |
| 1741 | 1741 | print '<tr class="liste_titre">'; |
| 1742 | - print '<td>' . $langs->trans("Date") . '</td>'; |
|
| 1742 | + print '<td>'.$langs->trans("Date").'</td>'; |
|
| 1743 | 1743 | if (!empty($allprojectforuser)) { |
| 1744 | - print '<td>' . $langs->trans("Project") . '</td>'; |
|
| 1744 | + print '<td>'.$langs->trans("Project").'</td>'; |
|
| 1745 | 1745 | } |
| 1746 | 1746 | if (empty($id)) { |
| 1747 | - print '<td>' . $langs->trans("Task") . '</td>'; |
|
| 1747 | + print '<td>'.$langs->trans("Task").'</td>'; |
|
| 1748 | 1748 | } |
| 1749 | - print '<td>' . $langs->trans("By") . '</td>'; |
|
| 1750 | - print '<td>' . $langs->trans("Note") . '</td>'; |
|
| 1751 | - print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
| 1752 | - print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
| 1749 | + print '<td>'.$langs->trans("By").'</td>'; |
|
| 1750 | + print '<td>'.$langs->trans("Note").'</td>'; |
|
| 1751 | + print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
| 1752 | + print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
| 1753 | 1753 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
| 1754 | 1754 | print '<td></td>'; |
| 1755 | 1755 | |
@@ -1803,14 +1803,14 @@ discard block |
||
| 1803 | 1803 | print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
| 1804 | 1804 | } else { |
| 1805 | 1805 | if ($nboftasks) { |
| 1806 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 1806 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 1807 | 1807 | } |
| 1808 | 1808 | } |
| 1809 | 1809 | print '</td>'; |
| 1810 | 1810 | |
| 1811 | 1811 | // Note |
| 1812 | 1812 | print '<td>'; |
| 1813 | - print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
| 1813 | + print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
| 1814 | 1814 | print '</td>'; |
| 1815 | 1815 | |
| 1816 | 1816 | // Duration - Time spent |
@@ -1835,7 +1835,7 @@ discard block |
||
| 1835 | 1835 | if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { |
| 1836 | 1836 | print '<td class="nowraponall">'; |
| 1837 | 1837 | print img_picto('', 'service'); |
| 1838 | - print $form->select_produits((GETPOSTISSET('fk_product')?GETPOST("fk_product", 'int'):''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); |
|
| 1838 | + print $form->select_produits((GETPOSTISSET('fk_product') ?GETPOST("fk_product", 'int') : ''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); |
|
| 1839 | 1839 | print '</td>'; |
| 1840 | 1840 | } |
| 1841 | 1841 | } |
@@ -1878,7 +1878,7 @@ discard block |
||
| 1878 | 1878 | $selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 1879 | 1879 | |
| 1880 | 1880 | print '<div class="div-table-responsive">'; |
| 1881 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
| 1881 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
| 1882 | 1882 | |
| 1883 | 1883 | // Fields title search |
| 1884 | 1884 | // -------------------------------------------------------------------- |
@@ -1903,20 +1903,20 @@ discard block |
||
| 1903 | 1903 | } |
| 1904 | 1904 | // Thirdparty |
| 1905 | 1905 | if (!empty($arrayfields['p.fk_soc']['checked'])) { |
| 1906 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
| 1906 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
| 1907 | 1907 | } |
| 1908 | 1908 | |
| 1909 | 1909 | // Thirdparty alias |
| 1910 | 1910 | if (!empty($arrayfields['s.name_alias']['checked'])) { |
| 1911 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
| 1911 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
| 1912 | 1912 | } |
| 1913 | 1913 | |
| 1914 | 1914 | if (!empty($allprojectforuser)) { |
| 1915 | 1915 | if (!empty($arrayfields['p.project_ref']['checked'])) { |
| 1916 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
| 1916 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
| 1917 | 1917 | } |
| 1918 | 1918 | if (!empty($arrayfields['p.project_label']['checked'])) { |
| 1919 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
| 1919 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | } |
| 1922 | 1922 | // Task |
@@ -1934,7 +1934,7 @@ discard block |
||
| 1934 | 1934 | } |
| 1935 | 1935 | // Note |
| 1936 | 1936 | if (!empty($arrayfields['t.note']['checked'])) { |
| 1937 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
| 1937 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
| 1938 | 1938 | } |
| 1939 | 1939 | // Duration |
| 1940 | 1940 | if (!empty($arrayfields['t.element_duration']['checked'])) { |
@@ -1945,7 +1945,7 @@ discard block |
||
| 1945 | 1945 | if ($search_timespent_starthour || $search_timespent_startmin) { |
| 1946 | 1946 | $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
| 1947 | 1947 | } |
| 1948 | - print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
| 1948 | + print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
| 1949 | 1949 | print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
| 1950 | 1950 | print '</div>'; |
| 1951 | 1951 | |
@@ -1953,7 +1953,7 @@ discard block |
||
| 1953 | 1953 | if ($search_timespent_endhour || $search_timespent_endmin) { |
| 1954 | 1954 | $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
| 1955 | 1955 | } |
| 1956 | - print '<div class="nowraponall">' . $langs->trans('at') . ' '; |
|
| 1956 | + print '<div class="nowraponall">'.$langs->trans('at').' '; |
|
| 1957 | 1957 | print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
| 1958 | 1958 | print '</div>'; |
| 1959 | 1959 | |
@@ -1969,7 +1969,7 @@ discard block |
||
| 1969 | 1969 | } |
| 1970 | 1970 | // Value billed |
| 1971 | 1971 | if (!empty($arrayfields['valuebilled']['checked'])) { |
| 1972 | - print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
| 1972 | + print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
| 1973 | 1973 | } |
| 1974 | 1974 | |
| 1975 | 1975 | /* |
@@ -1987,7 +1987,7 @@ discard block |
||
| 1987 | 1987 | print $searchpicto; |
| 1988 | 1988 | print '</td>'; |
| 1989 | 1989 | } |
| 1990 | - print '</tr>' . "\n"; |
|
| 1990 | + print '</tr>'."\n"; |
|
| 1991 | 1991 | |
| 1992 | 1992 | $totalarray = array(); |
| 1993 | 1993 | $totalarray['nbfield'] = 0; |
@@ -2097,7 +2097,7 @@ discard block |
||
| 2097 | 2097 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 2098 | 2098 | print '<td class="center nowraponall">'; |
| 2099 | 2099 | if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) { |
| 2100 | - print '<input type="hidden" name="lineid" value="' . GETPOST('lineid', 'int') . '">'; |
|
| 2100 | + print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">'; |
|
| 2101 | 2101 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
| 2102 | 2102 | print '<br>'; |
| 2103 | 2103 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
@@ -2105,7 +2105,7 @@ discard block |
||
| 2105 | 2105 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
| 2106 | 2106 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
| 2107 | 2107 | print ' '; |
| 2108 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
| 2108 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
| 2109 | 2109 | print img_split('', 'class="pictofixedwidth"'); |
| 2110 | 2110 | print '</a>'; |
| 2111 | 2111 | } |
@@ -2124,7 +2124,7 @@ discard block |
||
| 2124 | 2124 | $selected = 1; |
| 2125 | 2125 | } |
| 2126 | 2126 | print ' '; |
| 2127 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
| 2127 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
| 2128 | 2128 | } |
| 2129 | 2129 | } |
| 2130 | 2130 | } |
@@ -2242,7 +2242,7 @@ discard block |
||
| 2242 | 2242 | } |
| 2243 | 2243 | } |
| 2244 | 2244 | } elseif ($action !== 'createtime') { |
| 2245 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
| 2245 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
| 2246 | 2246 | } |
| 2247 | 2247 | |
| 2248 | 2248 | // Task label |
@@ -2272,7 +2272,7 @@ discard block |
||
| 2272 | 2272 | print img_object('', 'user', 'class="hideonsmartphone"'); |
| 2273 | 2273 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'maxwidth200'); |
| 2274 | 2274 | } else { |
| 2275 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2275 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2276 | 2276 | } |
| 2277 | 2277 | } else { |
| 2278 | 2278 | $userstatic->id = $task_time->fk_user; |
@@ -2292,7 +2292,7 @@ discard block |
||
| 2292 | 2292 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2293 | 2293 | if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
| 2294 | 2294 | print '<td class="small">'; |
| 2295 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2295 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2296 | 2296 | print '</td>'; |
| 2297 | 2297 | } else { |
| 2298 | 2298 | print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">'; |
@@ -2303,7 +2303,7 @@ discard block |
||
| 2303 | 2303 | $totalarray['nbfield']++; |
| 2304 | 2304 | } |
| 2305 | 2305 | } elseif ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
| 2306 | - print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2306 | + print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2307 | 2307 | } |
| 2308 | 2308 | |
| 2309 | 2309 | // Time spent |
@@ -2364,7 +2364,7 @@ discard block |
||
| 2364 | 2364 | $value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
| 2365 | 2365 | |
| 2366 | 2366 | print '<td class="nowraponall right">'; |
| 2367 | - print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
| 2367 | + print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
| 2368 | 2368 | print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
| 2369 | 2369 | print '</span>'; |
| 2370 | 2370 | print '</td>'; |
@@ -2397,7 +2397,7 @@ discard block |
||
| 2397 | 2397 | if ($task_time->invoice_id) { |
| 2398 | 2398 | $result = $tmpinvoice->fetch($task_time->invoice_id); |
| 2399 | 2399 | if ($result > 0) { |
| 2400 | - if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) { |
|
| 2400 | + if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { |
|
| 2401 | 2401 | print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id)); |
| 2402 | 2402 | } else { |
| 2403 | 2403 | print $tmpinvoice->getNomUrl(1); |
@@ -2415,7 +2415,7 @@ discard block |
||
| 2415 | 2415 | print $langs->trans("No"); |
| 2416 | 2416 | } |
| 2417 | 2417 | } else { |
| 2418 | - print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
| 2418 | + print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
| 2419 | 2419 | } |
| 2420 | 2420 | } |
| 2421 | 2421 | print '</td>'; |
@@ -2446,7 +2446,7 @@ discard block |
||
| 2446 | 2446 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
| 2447 | 2447 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
| 2448 | 2448 | print ' '; |
| 2449 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
| 2449 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
| 2450 | 2450 | print img_split('', 'class="pictofixedwidth"'); |
| 2451 | 2451 | print '</a>'; |
| 2452 | 2452 | } |
@@ -2465,7 +2465,7 @@ discard block |
||
| 2465 | 2465 | $selected = 1; |
| 2466 | 2466 | } |
| 2467 | 2467 | print ' '; |
| 2468 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
| 2468 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
| 2469 | 2469 | } |
| 2470 | 2470 | } |
| 2471 | 2471 | } |
@@ -2555,7 +2555,7 @@ discard block |
||
| 2555 | 2555 | print img_object('', 'user', 'class="hideonsmartphone"'); |
| 2556 | 2556 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); |
| 2557 | 2557 | } else { |
| 2558 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2558 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2559 | 2559 | } |
| 2560 | 2560 | } else { |
| 2561 | 2561 | $userstatic->id = $task_time->fk_user; |
@@ -2572,13 +2572,13 @@ discard block |
||
| 2572 | 2572 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2573 | 2573 | print '<td class="tdoverflowmax300">'; |
| 2574 | 2574 | if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
| 2575 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2575 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2576 | 2576 | } else { |
| 2577 | 2577 | print dol_nl2br($task_time->note); |
| 2578 | 2578 | } |
| 2579 | 2579 | print '</td>'; |
| 2580 | 2580 | } elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
| 2581 | - print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2581 | + print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2582 | 2582 | } |
| 2583 | 2583 | |
| 2584 | 2584 | // Time spent |
@@ -2711,7 +2711,7 @@ discard block |
||
| 2711 | 2711 | print img_object('', 'user', 'class="hideonsmartphone"'); |
| 2712 | 2712 | print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); |
| 2713 | 2713 | } else { |
| 2714 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2714 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
| 2715 | 2715 | } |
| 2716 | 2716 | } else { |
| 2717 | 2717 | $userstatic->id = $task_time->fk_user; |
@@ -2728,13 +2728,13 @@ discard block |
||
| 2728 | 2728 | if (!empty($arrayfields['t.note']['checked'])) { |
| 2729 | 2729 | print '<td class="small tdoverflowmax300"">'; |
| 2730 | 2730 | if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
| 2731 | - print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
| 2731 | + print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
| 2732 | 2732 | } else { |
| 2733 | 2733 | print dol_nl2br($task_time->note); |
| 2734 | 2734 | } |
| 2735 | 2735 | print '</td>'; |
| 2736 | 2736 | } elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
| 2737 | - print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
| 2737 | + print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
| 2738 | 2738 | } |
| 2739 | 2739 | |
| 2740 | 2740 | // Time spent |
@@ -2806,14 +2806,14 @@ discard block |
||
| 2806 | 2806 | $i++; |
| 2807 | 2807 | if ($i == 1) { |
| 2808 | 2808 | if ($num < $limit && empty($offset)) { |
| 2809 | - print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
| 2809 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
| 2810 | 2810 | } else { |
| 2811 | 2811 | print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
| 2812 | 2812 | } |
| 2813 | 2813 | } elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) { |
| 2814 | - print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
| 2814 | + print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
| 2815 | 2815 | } elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) { |
| 2816 | - print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
| 2816 | + print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
| 2817 | 2817 | //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
| 2818 | 2818 | } else { |
| 2819 | 2819 | print '<td></td>'; |
@@ -2829,8 +2829,8 @@ discard block |
||
| 2829 | 2829 | $totalnboffields++; |
| 2830 | 2830 | } |
| 2831 | 2831 | } |
| 2832 | - print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
| 2833 | - print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
| 2832 | + print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
| 2833 | + print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
| 2834 | 2834 | print '</td></tr>'; |
| 2835 | 2835 | } |
| 2836 | 2836 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | if (getDolGlobalString('CONTRACT_ADDON')) { |
| 302 | 302 | $mybool = false; |
| 303 | 303 | |
| 304 | - $file = getDolGlobalString('CONTRACT_ADDON') . ".php"; |
|
| 304 | + $file = getDolGlobalString('CONTRACT_ADDON').".php"; |
|
| 305 | 305 | $classname = getDolGlobalString('CONTRACT_ADDON'); |
| 306 | 306 | |
| 307 | 307 | // Include file with class |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | if ($contratline->statut != ContratLigne::STATUS_OPEN) { |
| 411 | 411 | $contratline->context = $this->context; |
| 412 | 412 | |
| 413 | - $result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE |
|
| 413 | + $result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE |
|
| 414 | 414 | if ($result < 0) { |
| 415 | 415 | $error++; |
| 416 | 416 | $this->error = $contratline->error; |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | // Close lines not already closed |
| 461 | 461 | if ($contratline->statut != ContratLigne::STATUS_CLOSED) { |
| 462 | 462 | $contratline->date_end_real = $now; |
| 463 | - $contratline->date_cloture = $now; // For backward compatibility |
|
| 463 | + $contratline->date_cloture = $now; // For backward compatibility |
|
| 464 | 464 | $contratline->user_closing_id = $user->id; |
| 465 | 465 | $contratline->statut = ContratLigne::STATUS_CLOSED; |
| 466 | 466 | $result = $contratline->close_line($user, $now, $comment, $notrigger); |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | if (!$error) { |
| 600 | 600 | $this->ref = $num; |
| 601 | 601 | $this->status = self::STATUS_VALIDATED; |
| 602 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 602 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 603 | 603 | $this->date_validation = $now; |
| 604 | 604 | } |
| 605 | 605 | } else { |
@@ -869,10 +869,10 @@ discard block |
||
| 869 | 869 | $line->localtax2_tx = $objp->localtax2_tx; |
| 870 | 870 | $line->localtax1_type = $objp->localtax1_type; |
| 871 | 871 | $line->localtax2_type = $objp->localtax2_type; |
| 872 | - $line->subprice = $objp->subprice; |
|
| 872 | + $line->subprice = $objp->subprice; |
|
| 873 | 873 | $line->statut = $objp->status; |
| 874 | 874 | $line->status = $objp->status; |
| 875 | - $line->remise_percent = $objp->remise_percent; |
|
| 875 | + $line->remise_percent = $objp->remise_percent; |
|
| 876 | 876 | $line->price_ht = $objp->price_ht; |
| 877 | 877 | $line->price = $objp->price_ht; // For backward compatibility |
| 878 | 878 | $line->total_ht = $objp->total_ht; |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | //$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); |
| 916 | 916 | //$line->date_fin_reel = $this->db->jdate($objp->date_cloture); |
| 917 | 917 | |
| 918 | - $line->rang = $objp->rang; |
|
| 918 | + $line->rang = $objp->rang; |
|
| 919 | 919 | |
| 920 | 920 | // Retrieve all extrafields for contract line |
| 921 | 921 | // fetch optionals attributes and labels |
@@ -1427,7 +1427,7 @@ discard block |
||
| 1427 | 1427 | } |
| 1428 | 1428 | |
| 1429 | 1429 | if (!$error) { |
| 1430 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
| 1430 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
| 1431 | 1431 | if ($result < 0) { |
| 1432 | 1432 | $error++; |
| 1433 | 1433 | } |
@@ -2063,7 +2063,7 @@ discard block |
||
| 2063 | 2063 | } |
| 2064 | 2064 | $datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1); |
| 2065 | 2065 | } |
| 2066 | - $datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer; |
|
| 2066 | + $datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer; |
|
| 2067 | 2067 | if (!$nofetch) { |
| 2068 | 2068 | $langs->load('project'); |
| 2069 | 2069 | if (empty($this->project)) { |
@@ -2529,7 +2529,7 @@ discard block |
||
| 2529 | 2529 | global $user; |
| 2530 | 2530 | |
| 2531 | 2531 | $ticket = new Ticket($this->db); |
| 2532 | - $nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id)); |
|
| 2532 | + $nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id)); |
|
| 2533 | 2533 | |
| 2534 | 2534 | return ($nbTicket < 0 ? $nbTicket : $ticket->lines); |
| 2535 | 2535 | } |
@@ -2551,7 +2551,7 @@ discard block |
||
| 2551 | 2551 | global $conf, $langs; |
| 2552 | 2552 | |
| 2553 | 2553 | if (!dol_strlen($modele)) { |
| 2554 | - $modele = ''; // No doc template/generation by default |
|
| 2554 | + $modele = ''; // No doc template/generation by default |
|
| 2555 | 2555 | |
| 2556 | 2556 | if (!empty($this->model_pdf)) { |
| 2557 | 2557 | $modele = $this->model_pdf; |
@@ -2648,14 +2648,14 @@ discard block |
||
| 2648 | 2648 | } |
| 2649 | 2649 | } |
| 2650 | 2650 | |
| 2651 | - if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) { |
|
| 2651 | + if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) { |
|
| 2652 | 2652 | $this->error = 'ErrorSetupNotComplete'; |
| 2653 | 2653 | dol_syslog($this->error); |
| 2654 | 2654 | return -1; |
| 2655 | 2655 | } |
| 2656 | 2656 | |
| 2657 | 2657 | // Set ref |
| 2658 | - require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php'; |
|
| 2658 | + require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php'; |
|
| 2659 | 2659 | $obj = getDolGlobalString('CONTRACT_ADDON'); |
| 2660 | 2660 | $modContract = new $obj(); |
| 2661 | 2661 | $clonedObj->ref = $modContract->getNextValue($objsoc, $clonedObj); |
@@ -2742,7 +2742,7 @@ discard block |
||
| 2742 | 2742 | |
| 2743 | 2743 | $error = 0; |
| 2744 | 2744 | $this->output = ''; |
| 2745 | - $this->error=''; |
|
| 2745 | + $this->error = ''; |
|
| 2746 | 2746 | |
| 2747 | 2747 | $contractlineprocessed = array(); |
| 2748 | 2748 | $contractignored = array(); |
@@ -2751,13 +2751,13 @@ discard block |
||
| 2751 | 2751 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 2752 | 2752 | |
| 2753 | 2753 | $sql = 'SELECT c.rowid, c.ref_customer, cd.rowid as lid, cd.date_fin_validite, p.duration'; |
| 2754 | - $sql.= ' FROM '.MAIN_DB_PREFIX.'contrat as c, '.MAIN_DB_PREFIX.'contratdet as cd'; |
|
| 2755 | - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON p.rowid = cd.fk_product'; |
|
| 2756 | - $sql.= ' WHERE cd.fk_contrat = c.rowid'; |
|
| 2757 | - $sql.= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')"; |
|
| 2758 | - $sql.= " AND cd.statut = 4"; |
|
| 2754 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'contrat as c, '.MAIN_DB_PREFIX.'contratdet as cd'; |
|
| 2755 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON p.rowid = cd.fk_product'; |
|
| 2756 | + $sql .= ' WHERE cd.fk_contrat = c.rowid'; |
|
| 2757 | + $sql .= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')"; |
|
| 2758 | + $sql .= " AND cd.statut = 4"; |
|
| 2759 | 2759 | if ($thirdparty_id > 0) { |
| 2760 | - $sql.=" AND c.fk_soc = ".((int) $thirdparty_id); |
|
| 2760 | + $sql .= " AND c.fk_soc = ".((int) $thirdparty_id); |
|
| 2761 | 2761 | } |
| 2762 | 2762 | //print $sql; |
| 2763 | 2763 | |
@@ -2767,7 +2767,7 @@ discard block |
||
| 2767 | 2767 | |
| 2768 | 2768 | include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
| 2769 | 2769 | |
| 2770 | - $i=0; |
|
| 2770 | + $i = 0; |
|
| 2771 | 2771 | while ($i < $num) { |
| 2772 | 2772 | $obj = $this->db->fetch_object($resql); |
| 2773 | 2773 | if ($obj) { |
@@ -2777,7 +2777,7 @@ discard block |
||
| 2777 | 2777 | |
| 2778 | 2778 | // Load contract |
| 2779 | 2779 | $object = new Contrat($this->db); |
| 2780 | - $object->fetch($obj->rowid); // fetch also lines |
|
| 2780 | + $object->fetch($obj->rowid); // fetch also lines |
|
| 2781 | 2781 | //$object->fetch_thirdparty(); |
| 2782 | 2782 | |
| 2783 | 2783 | if ($object->id <= 0) { |
@@ -2804,7 +2804,7 @@ discard block |
||
| 2804 | 2804 | usort($object->linkedObjects['facture'], array('Contrat', 'contractCmpDate')); |
| 2805 | 2805 | //dol_sort_array($object->linkedObjects['facture'], 'date'); |
| 2806 | 2806 | |
| 2807 | - $someinvoicenotpaid=0; |
|
| 2807 | + $someinvoicenotpaid = 0; |
|
| 2808 | 2808 | foreach ($object->linkedObjects['facture'] as $idinvoice => $invoice) { |
| 2809 | 2809 | if ($invoice->statut == Facture::STATUS_DRAFT) { |
| 2810 | 2810 | continue; |
@@ -2824,7 +2824,7 @@ discard block |
||
| 2824 | 2824 | if ($expirationdate && $expirationdate < $enddatetoscan) { |
| 2825 | 2825 | dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate); |
| 2826 | 2826 | $newdate = $expirationdate; |
| 2827 | - $protecti=0; //$protecti is to avoid infinite loop |
|
| 2827 | + $protecti = 0; //$protecti is to avoid infinite loop |
|
| 2828 | 2828 | while ($newdate < $enddatetoscan && $protecti < 1000) { |
| 2829 | 2829 | $newdate = dol_time_plus_duree($newdate, $duration_value, $duration_unit); |
| 2830 | 2830 | $protecti++; |
@@ -2842,39 +2842,39 @@ discard block |
||
| 2842 | 2842 | $comment = 'Renew date of contract '.$object->ref.' line '.$obj->lid.' by doAutoRenewContracts'; |
| 2843 | 2843 | |
| 2844 | 2844 | $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."contratdet SET date_fin_validite = '".$this->db->idate($newdate)."'"; |
| 2845 | - $sqlupdate.= ' WHERE rowid = '.((int) $obj->lid); |
|
| 2845 | + $sqlupdate .= ' WHERE rowid = '.((int) $obj->lid); |
|
| 2846 | 2846 | $resqlupdate = $this->db->query($sqlupdate); |
| 2847 | 2847 | if ($resqlupdate) { |
| 2848 | - $contractlineprocessed[$obj->lid]=$object->ref; |
|
| 2848 | + $contractlineprocessed[$obj->lid] = $object->ref; |
|
| 2849 | 2849 | |
| 2850 | 2850 | $actioncode = 'RENEW_CONTRACT'; |
| 2851 | 2851 | $now = dol_now(); |
| 2852 | 2852 | |
| 2853 | 2853 | // Create an event |
| 2854 | 2854 | $actioncomm = new ActionComm($this->db); |
| 2855 | - $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
| 2855 | + $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
| 2856 | 2856 | $actioncomm->code = 'AC_'.$actioncode; |
| 2857 | 2857 | $actioncomm->label = $label; |
| 2858 | 2858 | $actioncomm->datep = $now; |
| 2859 | 2859 | $actioncomm->datef = $now; |
| 2860 | - $actioncomm->percentage = -1; // Not applicable |
|
| 2860 | + $actioncomm->percentage = -1; // Not applicable |
|
| 2861 | 2861 | $actioncomm->socid = $object->socid; |
| 2862 | - $actioncomm->authorid = $user->id; // User saving action |
|
| 2863 | - $actioncomm->userownerid = $user->id; // Owner of action |
|
| 2862 | + $actioncomm->authorid = $user->id; // User saving action |
|
| 2863 | + $actioncomm->userownerid = $user->id; // Owner of action |
|
| 2864 | 2864 | $actioncomm->fk_element = $object->id; |
| 2865 | 2865 | $actioncomm->elementtype = 'contract'; |
| 2866 | 2866 | $actioncomm->note_private = $comment; |
| 2867 | 2867 | |
| 2868 | - $ret = $actioncomm->create($user); // User creating action |
|
| 2868 | + $ret = $actioncomm->create($user); // User creating action |
|
| 2869 | 2869 | } else { |
| 2870 | - $contracterror[$object->id]=$object->ref; |
|
| 2870 | + $contracterror[$object->id] = $object->ref; |
|
| 2871 | 2871 | |
| 2872 | 2872 | $error++; |
| 2873 | 2873 | $errorforlocaltransaction++; |
| 2874 | 2874 | $this->error = $this->db->lasterror(); |
| 2875 | 2875 | } |
| 2876 | 2876 | |
| 2877 | - if (! $errorforlocaltransaction) { |
|
| 2877 | + if (!$errorforlocaltransaction) { |
|
| 2878 | 2878 | $this->db->commit(); |
| 2879 | 2879 | } else { |
| 2880 | 2880 | $this->db->rollback(); |
@@ -2893,7 +2893,7 @@ discard block |
||
| 2893 | 2893 | $this->error = $this->db->lasterror(); |
| 2894 | 2894 | } |
| 2895 | 2895 | |
| 2896 | - $this->output .= count($contractlineprocessed).' contract line(s) with end date before '.dol_print_date($enddatetoscan, 'day').' were renewed'.(count($contractlineprocessed)>0 ? ' : '.implode(',', $contractlineprocessed) : ''); |
|
| 2896 | + $this->output .= count($contractlineprocessed).' contract line(s) with end date before '.dol_print_date($enddatetoscan, 'day').' were renewed'.(count($contractlineprocessed) > 0 ? ' : '.implode(',', $contractlineprocessed) : ''); |
|
| 2897 | 2897 | |
| 2898 | 2898 | return ($error ? 1 : 0); |
| 2899 | 2899 | } |
@@ -4268,7 +4268,7 @@ discard block |
||
| 4268 | 4268 | |
| 4269 | 4269 | if (!is_object($user)) { |
| 4270 | 4270 | include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
| 4271 | - $user = new User($db); // To avoid error during migration |
|
| 4271 | + $user = new User($db); // To avoid error during migration |
|
| 4272 | 4272 | } |
| 4273 | 4273 | |
| 4274 | 4274 | dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force.", listofmodule=".implode(',', array_keys($listofmodule))); |
@@ -5075,17 +5075,17 @@ discard block |
||
| 5075 | 5075 | print '<b>'.$langs->trans('MigrationContractLineRank')."</b><br>\n"; |
| 5076 | 5076 | |
| 5077 | 5077 | $sql = "SELECT c.rowid as cid ,cd.rowid as cdid,cd.rang FROM ".$db->prefix()."contratdet as cd INNER JOIN ".$db->prefix()."contrat as c ON c.rowid=cd.fk_contrat AND cd.rang=0"; |
| 5078 | - $sql .=" ORDER BY c.rowid,cd.rowid"; |
|
| 5078 | + $sql .= " ORDER BY c.rowid,cd.rowid"; |
|
| 5079 | 5079 | |
| 5080 | 5080 | $resql = $db->query($sql); |
| 5081 | 5081 | if ($resql) { |
| 5082 | - $currentRank=0; |
|
| 5083 | - $current_contract=0; |
|
| 5082 | + $currentRank = 0; |
|
| 5083 | + $current_contract = 0; |
|
| 5084 | 5084 | while ($obj = $db->fetch_object($resql)) { |
| 5085 | - if (empty($current_contract) || $current_contract==$obj->cid) { |
|
| 5085 | + if (empty($current_contract) || $current_contract == $obj->cid) { |
|
| 5086 | 5086 | $currentRank++; |
| 5087 | 5087 | } else { |
| 5088 | - $currentRank=1; |
|
| 5088 | + $currentRank = 1; |
|
| 5089 | 5089 | } |
| 5090 | 5090 | |
| 5091 | 5091 | $sqlUpd = "UPDATE ".$db->prefix()."contratdet SET rang=".(int) $currentRank." WHERE rowid=".(int) $obj->cdid; |
@@ -5097,7 +5097,7 @@ discard block |
||
| 5097 | 5097 | $error++; |
| 5098 | 5098 | } |
| 5099 | 5099 | |
| 5100 | - $current_contract = $obj->cid; |
|
| 5100 | + $current_contract = $obj->cid; |
|
| 5101 | 5101 | } |
| 5102 | 5102 | } else { |
| 5103 | 5103 | $error++; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $conf->global->AGENDA_EXT_NB = 5; |
| 50 | 50 | } |
| 51 | 51 | $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB'); |
| 52 | -$DELAYFORCACHE = 300; // 300 seconds |
|
| 52 | +$DELAYFORCACHE = 300; // 300 seconds |
|
| 53 | 53 | |
| 54 | 54 | $disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); |
| 55 | 55 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $mode = GETPOST('mode', 'aZ09'); |
| 108 | 108 | if (empty($mode) && preg_match('/show_/', $action)) { |
| 109 | - $mode = $action; // For backward compatibility |
|
| 109 | + $mode = $action; // For backward compatibility |
|
| 110 | 110 | } |
| 111 | 111 | $resourceid = GETPOST("search_resourceid", "int"); |
| 112 | 112 | $year = GETPOST("year", "int") ? GETPOST("year", "int") : date("Y"); |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | |
| 534 | 534 | $viewmode .= '</div>'; |
| 535 | 535 | |
| 536 | -$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools |
|
| 536 | +$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools |
|
| 537 | 537 | |
| 538 | 538 | |
| 539 | 539 | $newcardbutton = ''; |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | $newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode); |
| 545 | 545 | |
| 546 | 546 | //$param='month='.$monthshown.'&year='.$year; |
| 547 | - $hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation |
|
| 547 | + $hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation |
|
| 548 | 548 | |
| 549 | 549 | $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); |
| 550 | 550 | } |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | $sql .= " WHERE bc.status = 1"; |
| 565 | 565 | $sql .= " AND ba.status = 1"; |
| 566 | 566 | if (!empty($filtert) && $filtert != -1) { |
| 567 | - $sql .= " AND bc.visibility = ".(int) $filtert ; |
|
| 567 | + $sql .= " AND bc.visibility = ".(int) $filtert; |
|
| 568 | 568 | } |
| 569 | 569 | $resql = $db->query($sql); |
| 570 | 570 | if ($resql) { |
@@ -617,9 +617,9 @@ discard block |
||
| 617 | 617 | // Holiday calendar |
| 618 | 618 | $s .= ' |
| 619 | 619 | <div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"' . ($check_holiday |
| 620 | - ? ' checked' : '') . '> |
|
| 620 | + ? ' checked' : '').'> |
|
| 621 | 621 | <label for="check_holiday"> |
| 622 | - <span class="check_holiday_text">' . $langs->trans("Holidays") . '</span> |
|
| 622 | + <span class="check_holiday_text">' . $langs->trans("Holidays").'</span> |
|
| 623 | 623 | </label> |
| 624 | 624 | </div>'; |
| 625 | 625 | } |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | $s .= '</script>'."\n"; |
| 646 | 646 | |
| 647 | 647 | foreach ($showextcals as $val) { |
| 648 | - $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char |
|
| 648 | + $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char |
|
| 649 | 649 | |
| 650 | 650 | if (!empty($val['default']) || GETPOST('check_ext'.$htmlname, 'int')) { |
| 651 | 651 | $default = "checked"; |
@@ -888,7 +888,7 @@ discard block |
||
| 888 | 888 | // event->datep and event->datef must be GMT date. |
| 889 | 889 | if ($event->fulldayevent) { |
| 890 | 890 | $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); |
| 891 | - $event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz |
|
| 891 | + $event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz |
|
| 892 | 892 | $event->datef = $db->jdate($obj->datep2, $tzforfullday ? 'tzuser' : 'tzserver'); |
| 893 | 893 | } else { |
| 894 | 894 | // Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1) |
@@ -966,8 +966,8 @@ discard block |
||
| 966 | 966 | // Loop on each day covered by action to prepare an index to show on calendar |
| 967 | 967 | $loop = true; |
| 968 | 968 | $j = 0; |
| 969 | - $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz |
|
| 970 | - $daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz |
|
| 969 | + $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz |
|
| 970 | + $daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz |
|
| 971 | 971 | /* |
| 972 | 972 | print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>'; |
| 973 | 973 | print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>'; |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | |
| 1096 | 1096 | if ($mode == 'show_day') { |
| 1097 | 1097 | // Request only leaves for the current selected day |
| 1098 | - $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time |
|
| 1098 | + $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time |
|
| 1099 | 1099 | } elseif ($mode == 'show_week') { |
| 1100 | 1100 | // Restrict on current month (we get more, but we will filter later) |
| 1101 | 1101 | $sql .= " AND date_debut < '".$db->idate(dol_get_last_day($year, $month))."'"; |
@@ -1486,7 +1486,7 @@ discard block |
||
| 1486 | 1486 | $theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220)); |
| 1487 | 1487 | } |
| 1488 | 1488 | |
| 1489 | -$massactionbutton =''; |
|
| 1489 | +$massactionbutton = ''; |
|
| 1490 | 1490 | |
| 1491 | 1491 | print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.'<span class="marginleftonly"></span>'.$newcardbutton, '', $limit, 1, 0, 1, $viewmode); |
| 1492 | 1492 | |
@@ -1632,7 +1632,7 @@ discard block |
||
| 1632 | 1632 | |
| 1633 | 1633 | for ($iter_day = 0; $iter_day < 7; $iter_day++) { |
| 1634 | 1634 | // Show days of the current week |
| 1635 | - $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server |
|
| 1635 | + $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server |
|
| 1636 | 1636 | $tmpday = dol_print_date($curtime, '%d', 'tzuserrel'); |
| 1637 | 1637 | $tmpmonth = dol_print_date($curtime, '%m', 'tzuserrel'); |
| 1638 | 1638 | $tmpyear = dol_print_date($curtime, '%Y', 'tzuserrel'); |
@@ -1855,9 +1855,9 @@ discard block |
||
| 1855 | 1855 | $tmpholiday = new Holiday($db); |
| 1856 | 1856 | |
| 1857 | 1857 | foreach ($eventarray as $daykey => $notused) { // daykey is the 'YYYYMMDD' to show according to user |
| 1858 | - $annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
| 1859 | - $mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
| 1860 | - $jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
| 1858 | + $annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
| 1859 | + $mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
| 1860 | + $jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
| 1861 | 1861 | |
| 1862 | 1862 | //print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."<br>\n"; |
| 1863 | 1863 | //print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' day='.$day.' month='.$month.' year='.$year."<br>\n"; |
@@ -2144,7 +2144,7 @@ discard block |
||
| 2144 | 2144 | if ($event->type_code != 'ICALEVENT') { |
| 2145 | 2145 | $savlabel = $event->label ? $event->label : $event->libelle; |
| 2146 | 2146 | $event->label = $titletoshow; |
| 2147 | - $event->libelle = $titletoshow; // deprecatd |
|
| 2147 | + $event->libelle = $titletoshow; // deprecatd |
|
| 2148 | 2148 | // Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user. |
| 2149 | 2149 | $titletoshow = (($event->type_picto || $event->type_code) ? $event->getTypePicto() : ''); |
| 2150 | 2150 | $titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle inline-block', '', 0, 0); |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | if (!empty($user->email)) { |
| 183 | 183 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
| 184 | 184 | } else { |
| 185 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 185 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 186 | 186 | } |
| 187 | 187 | $replyto = $sendto; |
| 188 | 188 | $sendtocc = ''; |
| 189 | 189 | if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { |
| 190 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
| 190 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." should arrive in your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -272,12 +272,12 @@ discard block |
||
| 272 | 272 | if (!empty($user->email)) { |
| 273 | 273 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
| 274 | 274 | } else { |
| 275 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 275 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 276 | 276 | } |
| 277 | 277 | $replyto = $sendto; |
| 278 | 278 | $sendtocc = ''; |
| 279 | 279 | if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { |
| 280 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
| 280 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -317,19 +317,19 @@ discard block |
||
| 317 | 317 | $db->commit(); |
| 318 | 318 | } elseif ($event->type == 'payment_intent.succeeded') { // Called when making payment with PaymentIntent method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on). |
| 319 | 319 | //dol_syslog("object = ".var_export($event->data, true)); |
| 320 | - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
| 320 | + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
| 321 | 321 | global $stripearrayofkeysbyenv; |
| 322 | 322 | $error = 0; |
| 323 | 323 | $object = $event->data->object; |
| 324 | - $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
| 324 | + $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
| 325 | 325 | $ipaddress = $object->metadata->ipaddress; |
| 326 | 326 | $now = dol_now(); |
| 327 | 327 | $currencyCodeType = strtoupper($object->currency); |
| 328 | 328 | $paymentmethodstripeid = $object->payment_method; |
| 329 | 329 | $customer_id = $object->customer; |
| 330 | 330 | $invoice_id = ""; |
| 331 | - $paymentTypeId = ""; // payment type according to Stripe |
|
| 332 | - $paymentTypeIdInDolibarr = ""; // payment type according to Dolibarr |
|
| 331 | + $paymentTypeId = ""; // payment type according to Stripe |
|
| 332 | + $paymentTypeIdInDolibarr = ""; // payment type according to Dolibarr |
|
| 333 | 333 | $payment_amount = 0; |
| 334 | 334 | $payment_amountInDolibarr = 0; |
| 335 | 335 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | $s = new \Stripe\StripeClient($stripeacc); |
| 395 | 395 | |
| 396 | 396 | $paymentmethodstripe = $s->paymentMethods->retrieve($paymentmethodstripeid); |
| 397 | - $paymentTypeId = $paymentmethodstripe->type; |
|
| 397 | + $paymentTypeId = $paymentmethodstripe->type; |
|
| 398 | 398 | if ($paymentTypeId == "ban" || $paymentTypeId == "sepa_debit") { |
| 399 | 399 | $paymentTypeId = "PRE"; |
| 400 | 400 | } elseif ($paymentTypeId == "card") { |
@@ -418,9 +418,9 @@ discard block |
||
| 418 | 418 | $paiement->datepaye = $now; |
| 419 | 419 | $paiement->date = $now; |
| 420 | 420 | if ($currencyCodeType == $conf->currency) { |
| 421 | - $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
| 421 | + $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
| 422 | 422 | } else { |
| 423 | - $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
| 423 | + $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
| 424 | 424 | |
| 425 | 425 | $postactionmessages[] = 'Payment was done in a different currency than currency expected of company'; |
| 426 | 426 | $ispostactionok = -1; |
@@ -430,8 +430,8 @@ discard block |
||
| 430 | 430 | $paiement->paiementid = $paymentTypeId; |
| 431 | 431 | $paiement->num_payment = ''; |
| 432 | 432 | $paiement->note_public = ''; |
| 433 | - $paiement->note_private = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $servicestatus . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; |
|
| 434 | - $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
| 433 | + $paiement->note_private = 'StripeSepa payment '.dol_print_date($now, 'standard').' using '.$servicestatus.($ipaddress ? ' from ip '.$ipaddress : '').' - Transaction ID = '.$TRANSACTIONID; |
|
| 434 | + $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
| 435 | 435 | $paiement->ext_payment_site = $service; |
| 436 | 436 | |
| 437 | 437 | $ispaymentdone = 0; |
@@ -449,20 +449,20 @@ discard block |
||
| 449 | 449 | $db->begin(); |
| 450 | 450 | |
| 451 | 451 | if (!$error && !$ispaymentdone) { |
| 452 | - dol_syslog('* Record payment for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document'); |
|
| 452 | + dol_syslog('* Record payment for invoice id '.$invoice_id.'. It includes closing of invoice and regenerating document'); |
|
| 453 | 453 | |
| 454 | 454 | // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document |
| 455 | 455 | $paiement_id = $paiement->create($user, 1); |
| 456 | 456 | if ($paiement_id < 0) { |
| 457 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors); |
|
| 457 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors); |
|
| 458 | 458 | $ispostactionok = -1; |
| 459 | 459 | $error++; |
| 460 | 460 | |
| 461 | - dol_syslog("Failed to create the payment for invoice id " . $invoice_id); |
|
| 461 | + dol_syslog("Failed to create the payment for invoice id ".$invoice_id); |
|
| 462 | 462 | } else { |
| 463 | 463 | $postactionmessages[] = 'Payment created'; |
| 464 | 464 | |
| 465 | - dol_syslog("The payment has been created for invoice id " . $invoice_id); |
|
| 465 | + dol_syslog("The payment has been created for invoice id ".$invoice_id); |
|
| 466 | 466 | } |
| 467 | 467 | } |
| 468 | 468 | |
@@ -492,14 +492,14 @@ discard block |
||
| 492 | 492 | $label = '(CustomerInvoicePayment)'; |
| 493 | 493 | $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $customer_id, ''); |
| 494 | 494 | if ($result < 0) { |
| 495 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors); |
|
| 495 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors); |
|
| 496 | 496 | $ispostactionok = -1; |
| 497 | 497 | $error++; |
| 498 | 498 | } else { |
| 499 | 499 | $postactionmessages[] = 'Bank transaction of payment created (by ipn.php file)'; |
| 500 | 500 | } |
| 501 | 501 | } else { |
| 502 | - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; |
|
| 502 | + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; |
|
| 503 | 503 | $ispostactionok = -1; |
| 504 | 504 | $error++; |
| 505 | 505 | } |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | $error++; |
| 664 | 664 | } |
| 665 | 665 | |
| 666 | - if (! $error) { |
|
| 666 | + if (!$error) { |
|
| 667 | 667 | $db->commit(); |
| 668 | 668 | } else { |
| 669 | 669 | $db->rollback(); |