@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | |
38 | 38 | $langs->loadLangs(array('companies', 'contracts', 'tickets')); |
39 | 39 | |
40 | -$socid=GETPOST('socid', 'int'); |
|
41 | -$id=GETPOST('id', 'int'); |
|
42 | -$ref=GETPOST('ref', 'alpha'); |
|
43 | -$action=GETPOST('action', 'alpha'); |
|
40 | +$socid = GETPOST('socid', 'int'); |
|
41 | +$id = GETPOST('id', 'int'); |
|
42 | +$ref = GETPOST('ref', 'alpha'); |
|
43 | +$action = GETPOST('action', 'alpha'); |
|
44 | 44 | |
45 | 45 | if ($id == '' && $ref == '') { |
46 | 46 | dol_print_error('', 'Bad parameter'); |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | // Security check |
51 | -$socid=0; |
|
51 | +$socid = 0; |
|
52 | 52 | if ($user->socid > 0) |
53 | - $socid=$user->socid; |
|
53 | + $socid = $user->socid; |
|
54 | 54 | |
55 | -$result=restrictedArea($user, 'contrat', $id); |
|
55 | +$result = restrictedArea($user, 'contrat', $id); |
|
56 | 56 | |
57 | 57 | |
58 | 58 | /* |
@@ -62,62 +62,62 @@ discard block |
||
62 | 62 | llxHeader("", $langs->trans("Tickets"), "Contrat"); |
63 | 63 | |
64 | 64 | $form = new Form($db); |
65 | -$userstatic=new User($db); |
|
65 | +$userstatic = new User($db); |
|
66 | 66 | |
67 | -$object= new Contrat($db); |
|
68 | -$result=$object->fetch($id, $ref); |
|
69 | -$ret=$object->fetch_thirdparty(); |
|
67 | +$object = new Contrat($db); |
|
68 | +$result = $object->fetch($id, $ref); |
|
69 | +$ret = $object->fetch_thirdparty(); |
|
70 | 70 | $head = contract_prepare_head($object); |
71 | 71 | |
72 | 72 | |
73 | 73 | dol_fiche_head($head, 'ticket', $langs->trans("Contract"), -1, 'contract'); |
74 | 74 | |
75 | -$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'; |
|
76 | -$linkback.= $langs->trans("BackToList").'</a>'; |
|
75 | +$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'; |
|
76 | +$linkback .= $langs->trans("BackToList").'</a>'; |
|
77 | 77 | |
78 | -$morehtmlref=''; |
|
79 | -$morehtmlref.=$object->ref; |
|
78 | +$morehtmlref = ''; |
|
79 | +$morehtmlref .= $object->ref; |
|
80 | 80 | |
81 | -$morehtmlref.='<div class="refidno">'; |
|
81 | +$morehtmlref .= '<div class="refidno">'; |
|
82 | 82 | // Ref customer |
83 | -$morehtmlref.=$form->editfieldkey( |
|
83 | +$morehtmlref .= $form->editfieldkey( |
|
84 | 84 | "RefCustomer", 'ref_customer', $object->ref_customer, |
85 | 85 | $object, 0, 'string', '', 0, 1 |
86 | 86 | ); |
87 | -$morehtmlref.=$form->editfieldval( |
|
87 | +$morehtmlref .= $form->editfieldval( |
|
88 | 88 | "RefCustomer", 'ref_customer', $object->ref_customer, |
89 | 89 | $object, 0, 'string', '', null, null, '', 1 |
90 | 90 | ); |
91 | 91 | // Ref supplier |
92 | -$morehtmlref.='<br>'; |
|
93 | -$morehtmlref.=$form->editfieldkey( |
|
92 | +$morehtmlref .= '<br>'; |
|
93 | +$morehtmlref .= $form->editfieldkey( |
|
94 | 94 | "RefSupplier", 'ref_supplier', $object->ref_supplier, |
95 | 95 | $object, 0, 'string', '', 0, 1 |
96 | 96 | ); |
97 | -$morehtmlref.=$form->editfieldval( |
|
97 | +$morehtmlref .= $form->editfieldval( |
|
98 | 98 | "RefSupplier", 'ref_supplier', $object->ref_supplier, |
99 | 99 | $object, 0, 'string', '', null, null, '', 1 |
100 | 100 | ); |
101 | 101 | // Thirdparty |
102 | -$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); |
|
102 | +$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); |
|
103 | 103 | // Project |
104 | -if (! empty($conf->projet->enabled)) { |
|
104 | +if (!empty($conf->projet->enabled)) { |
|
105 | 105 | require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
106 | 106 | |
107 | 107 | $langs->load("projects"); |
108 | - $morehtmlref.='<br>'.$langs->trans('Project') . ' : '; |
|
109 | - if (! empty($object->fk_project)) { |
|
108 | + $morehtmlref .= '<br>'.$langs->trans('Project').' : '; |
|
109 | + if (!empty($object->fk_project)) { |
|
110 | 110 | $proj = new Project($db); |
111 | 111 | $proj->fetch($object->fk_project); |
112 | - $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id='; |
|
113 | - $morehtmlref.=$object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; |
|
114 | - $morehtmlref.=$proj->ref; |
|
115 | - $morehtmlref.='</a>'; |
|
112 | + $morehtmlref .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='; |
|
113 | + $morehtmlref .= $object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; |
|
114 | + $morehtmlref .= $proj->ref; |
|
115 | + $morehtmlref .= '</a>'; |
|
116 | 116 | } else { |
117 | - $morehtmlref.=''; |
|
117 | + $morehtmlref .= ''; |
|
118 | 118 | } |
119 | 119 | } |
120 | -$morehtmlref.='</div>'; |
|
120 | +$morehtmlref .= '</div>'; |
|
121 | 121 | |
122 | 122 | dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'none', $morehtmlref); |
123 | 123 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * Referers types |
129 | 129 | */ |
130 | 130 | |
131 | -$title=$langs->trans("ListTicketsLinkToContract"); |
|
131 | +$title = $langs->trans("ListTicketsLinkToContract"); |
|
132 | 132 | |
133 | 133 | print '<table class="noborder" width="100%">'; |
134 | 134 | print '<tr class="liste_titre">'; |
@@ -49,8 +49,9 @@ |
||
49 | 49 | |
50 | 50 | // Security check |
51 | 51 | $socid=0; |
52 | -if ($user->socid > 0) |
|
52 | +if ($user->socid > 0) { |
|
53 | 53 | $socid=$user->socid; |
54 | +} |
|
54 | 55 | |
55 | 56 | $result=restrictedArea($user, 'contrat', $id); |
56 | 57 |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | $result = 'found'; // If error, we force like if we found to avoid any deletion |
1156 | 1156 | } |
1157 | 1157 | } else { |
1158 | - $result = 'found'; // |
|
1158 | + $result = 'found'; // |
|
1159 | 1159 | } |
1160 | 1160 | |
1161 | 1161 | if (!$result) { |
@@ -1525,16 +1525,16 @@ discard block |
||
1525 | 1525 | |
1526 | 1526 | // Repair llx_commande_fournisseur to eleminate duplicate reference |
1527 | 1527 | if ($ok && GETPOST('repair_supplier_order_duplicate_ref')) { |
1528 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; |
|
1529 | - include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
1528 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; |
|
1529 | + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
1530 | 1530 | |
1531 | 1531 | $db->begin(); |
1532 | 1532 | |
1533 | 1533 | $err = 0; |
1534 | 1534 | |
1535 | 1535 | // Query to find all duplicate supplier orders |
1536 | - $sql = "SELECT * FROM " . MAIN_DB_PREFIX . "commande_fournisseur"; |
|
1537 | - $sql .= " WHERE ref IN (SELECT cf.ref FROM " . MAIN_DB_PREFIX . "commande_fournisseur cf GROUP BY cf.ref, cf.entity HAVING COUNT(cf.rowid) > 1)"; |
|
1536 | + $sql = "SELECT * FROM ".MAIN_DB_PREFIX."commande_fournisseur"; |
|
1537 | + $sql .= " WHERE ref IN (SELECT cf.ref FROM ".MAIN_DB_PREFIX."commande_fournisseur cf GROUP BY cf.ref, cf.entity HAVING COUNT(cf.rowid) > 1)"; |
|
1538 | 1538 | |
1539 | 1539 | // Build a list of ref => []CommandeFournisseur |
1540 | 1540 | $duplicateSupplierOrders = []; |
@@ -1560,7 +1560,7 @@ discard block |
||
1560 | 1560 | |
1561 | 1561 | $newRef = $supplierOrder->getNextNumRef($soc); |
1562 | 1562 | |
1563 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "commande_fournisseur cf SET cf.ref = '" . $db->escape($newRef) . "' WHERE cf.rowid = " . (int) $supplierOrder->id; |
|
1563 | + $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur cf SET cf.ref = '".$db->escape($newRef)."' WHERE cf.rowid = ".(int) $supplierOrder->id; |
|
1564 | 1564 | if (!$db->query($sql)) { |
1565 | 1565 | $err++; |
1566 | 1566 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php // BEGIN PHP |
2 | -$websitekey=basename(__DIR__); |
|
3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded |
|
2 | +$websitekey = basename(__DIR__); |
|
3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded |
|
4 | 4 | require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
5 | 5 | require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
6 | 6 | ob_start(); |
@@ -1,4 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page |
3 | 3 | global $dolibarr_main_data_root; |
4 | -if (empty($dolibarr_main_data_root)) require './page80.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page80.tpl.php'; |
|
4 | +if (empty($dolibarr_main_data_root)) { |
|
5 | + require './page80.tpl.php'; |
|
6 | +} else { |
|
7 | + require $dolibarr_main_data_root.'/website/'.$website->ref.'/page80.tpl.php'; |
|
8 | +} |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
|
4 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
|
4 | + if (!defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
5 | 5 | require_once '/var/www/html/dolibarr_dev/htdocs/master.inc.php'; |
6 | 6 | } |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
3 | 3 | if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
4 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
4 | + if (! defined('USEEXTERNALSERVER')) { |
|
5 | + define('USEEXTERNALSERVER', 1); |
|
6 | + } |
|
5 | 7 | require_once '/var/www/html/dolibarr_dev/htdocs/master.inc.php'; |
6 | 8 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php // BEGIN PHP |
2 | -$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; |
|
3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
|
2 | +$websitekey = basename(__DIR__); if (empty($websitepagefile)) $websitepagefile = __FILE__; |
|
3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
|
4 | 4 | $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; |
5 | 5 | require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; |
6 | 6 | } // Not already loaded |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php // BEGIN PHP |
2 | -$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; |
|
2 | +$websitekey=basename(__DIR__); if (empty($websitepagefile)) { |
|
3 | + $websitepagefile=__FILE__; |
|
4 | +} |
|
3 | 5 | if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
4 | 6 | $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; |
5 | 7 | require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; |
@@ -26,7 +28,10 @@ discard block |
||
26 | 28 | <!-- Include link to JS file --> |
27 | 29 | <script async src="/javascript.js.php"></script> |
28 | 30 | <!-- Include HTML header from common file --> |
29 | -<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; ?> |
|
31 | +<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) { |
|
32 | + include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; |
|
33 | +} |
|
34 | +?> |
|
30 | 35 | <!-- Include HTML header from page header block --> |
31 | 36 | <head> |
32 | 37 | <meta charset="UTF-8" /> |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php // BEGIN PHP |
2 | -$websitekey=basename(__DIR__); |
|
3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded |
|
2 | +$websitekey = basename(__DIR__); |
|
3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded |
|
4 | 4 | require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
5 | 5 | require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
6 | 6 | ob_start(); |
7 | -if (! headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */ |
|
7 | +if (!headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */ |
|
8 | 8 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
9 | 9 | header('Content-type: text/css'); |
10 | 10 | } |
@@ -1,5 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page |
3 | 3 | global $dolibarr_main_data_root; |
4 | -if (empty($dolibarr_main_data_root)) require './page249.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page249.tpl.php'; |
|
4 | +if (empty($dolibarr_main_data_root)) { |
|
5 | + require './page249.tpl.php'; |
|
6 | +} else { |
|
7 | + require $dolibarr_main_data_root.'/website/'.$website->ref.'/page249.tpl.php'; |
|
8 | +} |
|
5 | 9 | ?> |
@@ -1,5 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page |
3 | 3 | global $dolibarr_main_data_root; |
4 | -if (empty($dolibarr_main_data_root)) require './page252.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page252.tpl.php'; |
|
4 | +if (empty($dolibarr_main_data_root)) { |
|
5 | + require './page252.tpl.php'; |
|
6 | +} else { |
|
7 | + require $dolibarr_main_data_root.'/website/'.$website->ref.'/page252.tpl.php'; |
|
8 | +} |
|
5 | 9 | ?> |