@@ -1088,9 +1088,15 @@ |
||
| 1088 | 1088 | |
| 1089 | 1089 | if ($usemenuhider || empty($leftmenu) || $leftmenu == "setup") { |
| 1090 | 1090 | $nbmodulesnotautoenabled = count($conf->modules); |
| 1091 | - if (in_array('fckeditor', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 1092 | - if (in_array('export', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 1093 | - if (in_array('import', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 1091 | + if (in_array('fckeditor', $conf->modules)) { |
|
| 1092 | + $nbmodulesnotautoenabled--; |
|
| 1093 | + } |
|
| 1094 | + if (in_array('export', $conf->modules)) { |
|
| 1095 | + $nbmodulesnotautoenabled--; |
|
| 1096 | + } |
|
| 1097 | + if (in_array('import', $conf->modules)) { |
|
| 1098 | + $nbmodulesnotautoenabled--; |
|
| 1099 | + } |
|
| 1094 | 1100 | |
| 1095 | 1101 | // Load translation files required by the page |
| 1096 | 1102 | $langs->loadLangs(array("admin", "help")); |
@@ -43,9 +43,15 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | 45 | $nbmodulesnotautoenabled = count($conf->modules); |
| 46 | -if (in_array('fckeditor', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 47 | -if (in_array('export', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 48 | -if (in_array('import', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 46 | +if (in_array('fckeditor', $conf->modules)) { |
|
| 47 | + $nbmodulesnotautoenabled--; |
|
| 48 | +} |
|
| 49 | +if (in_array('export', $conf->modules)) { |
|
| 50 | + $nbmodulesnotautoenabled--; |
|
| 51 | +} |
|
| 52 | +if (in_array('import', $conf->modules)) { |
|
| 53 | + $nbmodulesnotautoenabled--; |
|
| 54 | +} |
|
| 49 | 55 | |
| 50 | 56 | // Check if company name is defined (first install) |
| 51 | 57 | if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_NOM)) { |
@@ -100,7 +100,9 @@ |
||
| 100 | 100 | if (!isModEnabled('hrm')) { |
| 101 | 101 | accessforbidden(); |
| 102 | 102 | } |
| 103 | -if (!$permissiontoread) accessforbidden(); |
|
| 103 | +if (!$permissiontoread) { |
|
| 104 | + accessforbidden(); |
|
| 105 | +} |
|
| 104 | 106 | |
| 105 | 107 | |
| 106 | 108 | /* |
@@ -89,7 +89,9 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); |
| 91 | 91 | |
| 92 | -if ($managedfor != 'member' && $sortfield == 'd.datefin') $sortfield = ''; |
|
| 92 | +if ($managedfor != 'member' && $sortfield == 'd.datefin') { |
|
| 93 | + $sortfield = ''; |
|
| 94 | +} |
|
| 93 | 95 | |
| 94 | 96 | // Default sort order (if not yet defined by previous GETPOST) |
| 95 | 97 | if (!$sortfield) { |
@@ -155,10 +157,18 @@ discard block |
||
| 155 | 157 | //if ($user->socid > 0) accessforbidden(); |
| 156 | 158 | //if ($user->socid > 0) $socid = $user->socid; |
| 157 | 159 | //$result = restrictedArea($user, 'partnership', $object->id); |
| 158 | -if (empty($conf->partnership->enabled)) accessforbidden(); |
|
| 159 | -if (empty($permissiontoread)) accessforbidden(); |
|
| 160 | -if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden(); |
|
| 161 | -if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden(); |
|
| 160 | +if (empty($conf->partnership->enabled)) { |
|
| 161 | + accessforbidden(); |
|
| 162 | +} |
|
| 163 | +if (empty($permissiontoread)) { |
|
| 164 | + accessforbidden(); |
|
| 165 | +} |
|
| 166 | +if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') { |
|
| 167 | + accessforbidden(); |
|
| 168 | +} |
|
| 169 | +if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') { |
|
| 170 | + accessforbidden(); |
|
| 171 | +} |
|
| 162 | 172 | |
| 163 | 173 | |
| 164 | 174 | /* |
@@ -206,7 +206,9 @@ |
||
| 206 | 206 | $triggersendname = 'TICKET_SENTBYMAIL'; |
| 207 | 207 | $paramname = 'id'; |
| 208 | 208 | $autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add |
| 209 | -if (!empty($object->dao->id)) $trackid = 'tic'.$object->dao->id; |
|
| 209 | +if (!empty($object->dao->id)) { |
|
| 210 | + $trackid = 'tic'.$object->dao->id; |
|
| 211 | +} |
|
| 210 | 212 | include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
| 211 | 213 | |
| 212 | 214 | |
@@ -55,7 +55,9 @@ discard block |
||
| 55 | 55 | $metaData=getDocMetaData($doc); |
| 56 | 56 | foreach ($links as $i) { |
| 57 | 57 | $link=$i->getAttribute('href'); |
| 58 | - if (ignoreLink($link)) continue; |
|
| 58 | + if (ignoreLink($link)) { |
|
| 59 | + continue; |
|
| 60 | + } |
|
| 59 | 61 | $link=convertLink($url, $link); |
| 60 | 62 | if (!in_array($link, $crawledLinks)) { |
| 61 | 63 | $crawledLinks[]=$link; |
@@ -63,9 +65,10 @@ discard block |
||
| 63 | 65 | insertIntoDatabase($link, $pageTitle, $metaData, $depth); |
| 64 | 66 | } |
| 65 | 67 | } |
| 66 | - foreach ($crawling as $crawlURL) |
|
| 67 | - followLink($crawlURL, $depth+1); |
|
| 68 | -} |
|
| 68 | + foreach ($crawling as $crawlURL) { |
|
| 69 | + followLink($crawlURL, $depth+1); |
|
| 70 | + } |
|
| 71 | + } |
|
| 69 | 72 | |
| 70 | 73 | /** |
| 71 | 74 | * @param string $site Site |
@@ -74,15 +77,17 @@ discard block |
||
| 74 | 77 | */ |
| 75 | 78 | function convertLink($site, $path) |
| 76 | 79 | { |
| 77 | - if (substr_compare($path, "//", 0, 2)==0) |
|
| 78 | - return parse_url($site)['scheme'].$path; |
|
| 79 | - elseif (substr_compare($path, "http://", 0, 7)==0 |
|
| 80 | + if (substr_compare($path, "//", 0, 2)==0) { |
|
| 81 | + return parse_url($site)['scheme'].$path; |
|
| 82 | + } elseif (substr_compare($path, "http://", 0, 7)==0 |
|
| 80 | 83 | or substr_compare($path, "https://", 0, 8)==0 |
| 81 | 84 | or substr_compare($path, "www.", 0, 4)==0 |
| 82 | - ) |
|
| 83 | - return $path; |
|
| 84 | - else return $site.'/'.$path; |
|
| 85 | -} |
|
| 85 | + ) { |
|
| 86 | + return $path; |
|
| 87 | + } else { |
|
| 88 | + return $site.'/'.$path; |
|
| 89 | + } |
|
| 90 | + } |
|
| 86 | 91 | |
| 87 | 92 | /** |
| 88 | 93 | * @param string $url URL |
@@ -117,8 +122,9 @@ discard block |
||
| 117 | 122 | function getDocTitle(&$doc, $url) |
| 118 | 123 | { |
| 119 | 124 | $titleNodes=$doc->getElementsByTagName('title'); |
| 120 | - if (count($titleNodes)==0 or !isset($titleNodes[0]->nodeValue)) |
|
| 121 | - return $url; |
|
| 125 | + if (count($titleNodes)==0 or !isset($titleNodes[0]->nodeValue)) { |
|
| 126 | + return $url; |
|
| 127 | + } |
|
| 122 | 128 | $title=str_replace('', '\n', $titleNodes[0]->nodeValue); |
| 123 | 129 | return (strlen($title)<1)?$url:$title; |
| 124 | 130 | } |
@@ -131,11 +137,15 @@ discard block |
||
| 131 | 137 | { |
| 132 | 138 | $metaData=array(); |
| 133 | 139 | $metaNodes=$doc->getElementsByTagName('meta'); |
| 134 | - foreach ($metaNodes as $node) |
|
| 135 | - $metaData[$node->getAttribute("name")] = $node->getAttribute("content"); |
|
| 136 | - if (!isset($metaData['description'])) |
|
| 137 | - $metaData['description']='No Description Available'; |
|
| 138 | - if (!isset($metaData['keywords'])) $metaData['keywords']=''; |
|
| 140 | + foreach ($metaNodes as $node) { |
|
| 141 | + $metaData[$node->getAttribute("name")] = $node->getAttribute("content"); |
|
| 142 | + } |
|
| 143 | + if (!isset($metaData['description'])) { |
|
| 144 | + $metaData['description']='No Description Available'; |
|
| 145 | + } |
|
| 146 | + if (!isset($metaData['keywords'])) { |
|
| 147 | + $metaData['keywords']=''; |
|
| 148 | + } |
|
| 139 | 149 | return array( |
| 140 | 150 | 'keywords'=>str_replace('', '\n', $metaData['keywords']), |
| 141 | 151 | 'description'=>str_replace('', '\n', $metaData['description']) |
@@ -25,9 +25,11 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | - public function do() |
|
| 28 | + public function do { |
|
| 29 | + () |
|
| 29 | 30 | { |
| 30 | 31 | global $globalaaa, $globalbbb; |
| 32 | + } |
|
| 31 | 33 | echo 'dobbb'."\n"; |
| 32 | 34 | $globalaaa.='+bbb'; |
| 33 | 35 | $globalbbb.='+bbb'; |
@@ -27,8 +27,10 @@ |
||
| 27 | 27 | * |
| 28 | 28 | * @return void |
| 29 | 29 | */ |
| 30 | - public function do() |
|
| 30 | + public function do { |
|
| 31 | + () |
|
| 31 | 32 | { |
| 32 | 33 | echo 'doaaa'."\n"; |
| 33 | 34 | } |
| 35 | + } |
|
| 34 | 36 | } |
@@ -201,7 +201,9 @@ discard block |
||
| 201 | 201 | if (!$notrigger) { |
| 202 | 202 | // Call trigger |
| 203 | 203 | $result = $this->call_trigger('SALARY_MODIFY', $user); |
| 204 | - if ($result < 0) $error++; |
|
| 204 | + if ($result < 0) { |
|
| 205 | + $error++; |
|
| 206 | + } |
|
| 205 | 207 | // End call triggers |
| 206 | 208 | } |
| 207 | 209 | |
@@ -382,7 +384,9 @@ discard block |
||
| 382 | 384 | $sql .= ", salary"; |
| 383 | 385 | $sql .= ", fk_typepayment"; |
| 384 | 386 | $sql .= ", fk_account"; |
| 385 | - if ($this->note) $sql .= ", note"; |
|
| 387 | + if ($this->note) { |
|
| 388 | + $sql .= ", note"; |
|
| 389 | + } |
|
| 386 | 390 | $sql .= ", label"; |
| 387 | 391 | $sql .= ", datesp"; |
| 388 | 392 | $sql .= ", dateep"; |
@@ -400,7 +404,9 @@ discard block |
||
| 400 | 404 | $sql .= ", ".($this->salary > 0 ? ((double) $this->salary) : "null"); |
| 401 | 405 | $sql .= ", ".($this->type_payment > 0 ? ((int) $this->type_payment) : 0); |
| 402 | 406 | $sql .= ", ".($this->accountid > 0 ? ((int) $this->accountid) : "null"); |
| 403 | - if ($this->note) $sql .= ", '".$this->db->escape($this->note)."'"; |
|
| 407 | + if ($this->note) { |
|
| 408 | + $sql .= ", '".$this->db->escape($this->note)."'"; |
|
| 409 | + } |
|
| 404 | 410 | $sql .= ", '".$this->db->escape($this->label)."'"; |
| 405 | 411 | $sql .= ", '".$this->db->idate($this->datesp)."'"; |
| 406 | 412 | $sql .= ", '".$this->db->idate($this->dateep)."'"; |
@@ -428,9 +434,13 @@ discard block |
||
| 428 | 434 | |
| 429 | 435 | // Call trigger |
| 430 | 436 | $result = $this->call_trigger('SALARY_CREATE', $user); |
| 431 | - if ($result < 0) $error++; |
|
| 437 | + if ($result < 0) { |
|
| 438 | + $error++; |
|
| 439 | + } |
|
| 432 | 440 | // End call triggers |
| 433 | - } else $error++; |
|
| 441 | + } else { |
|
| 442 | + $error++; |
|
| 443 | + } |
|
| 434 | 444 | |
| 435 | 445 | if (!$error) { |
| 436 | 446 | $this->db->commit(); |
@@ -503,7 +513,10 @@ discard block |
||
| 503 | 513 | global $dolibarr_main_authentication, $dolibarr_main_demo; |
| 504 | 514 | global $menumanager; |
| 505 | 515 | |
| 506 | - if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips |
|
| 516 | + if (!empty($conf->dol_no_mouse_hover)) { |
|
| 517 | + $notooltip = 1; |
|
| 518 | + } |
|
| 519 | + // Force disable tooltips |
|
| 507 | 520 | |
| 508 | 521 | $result = ''; |
| 509 | 522 | $params = [ |
@@ -564,8 +577,11 @@ discard block |
||
| 564 | 577 | $hookmanager->initHooks(array('salarypayment')); |
| 565 | 578 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
| 566 | 579 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 567 | - if ($reshook > 0) $result = $hookmanager->resPrint; |
|
| 568 | - else $result .= $hookmanager->resPrint; |
|
| 580 | + if ($reshook > 0) { |
|
| 581 | + $result = $hookmanager->resPrint; |
|
| 582 | + } else { |
|
| 583 | + $result .= $hookmanager->resPrint; |
|
| 584 | + } |
|
| 569 | 585 | |
| 570 | 586 | return $result; |
| 571 | 587 | } |
@@ -591,7 +607,9 @@ discard block |
||
| 591 | 607 | $amount = 0; |
| 592 | 608 | |
| 593 | 609 | $obj = $this->db->fetch_object($resql); |
| 594 | - if ($obj) $amount = $obj->amount ? $obj->amount : 0; |
|
| 610 | + if ($obj) { |
|
| 611 | + $amount = $obj->amount ? $obj->amount : 0; |
|
| 612 | + } |
|
| 595 | 613 | |
| 596 | 614 | $this->db->free($resql); |
| 597 | 615 | return $amount; |
@@ -718,15 +736,23 @@ discard block |
||
| 718 | 736 | //$langs->load("mymodule"); |
| 719 | 737 | $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); |
| 720 | 738 | $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); |
| 721 | - if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); |
|
| 739 | + if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) { |
|
| 740 | + $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); |
|
| 741 | + } |
|
| 722 | 742 | $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); |
| 723 | 743 | $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); |
| 724 | - if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); |
|
| 744 | + if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) { |
|
| 745 | + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); |
|
| 746 | + } |
|
| 725 | 747 | } |
| 726 | 748 | |
| 727 | 749 | $statusType = 'status1'; |
| 728 | - if ($status == 0 && $alreadypaid <> 0) $statusType = 'status3'; |
|
| 729 | - if ($status == 1) $statusType = 'status6'; |
|
| 750 | + if ($status == 0 && $alreadypaid <> 0) { |
|
| 751 | + $statusType = 'status3'; |
|
| 752 | + } |
|
| 753 | + if ($status == 1) { |
|
| 754 | + $statusType = 'status6'; |
|
| 755 | + } |
|
| 730 | 756 | |
| 731 | 757 | return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); |
| 732 | 758 | } |