@@ -82,7 +82,7 @@ |
||
82 | 82 | * @deprecated |
83 | 83 | * @see $subprice |
84 | 84 | */ |
85 | - public $price; |
|
85 | + public $price; |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * Unit price before taxes |
@@ -158,8 +158,8 @@ |
||
158 | 158 | // Support for html frontend |
159 | 159 | if (empty($conf->global->DAV_DISABLE_BROWSER)) |
160 | 160 | { |
161 | - $browser = new \Sabre\DAV\Browser\Plugin(); |
|
162 | - $server->addPlugin($browser); |
|
161 | + $browser = new \Sabre\DAV\Browser\Plugin(); |
|
162 | + $server->addPlugin($browser); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | // Automatically guess (some) contenttypes, based on extension |
@@ -25,12 +25,28 @@ discard block |
||
25 | 25 | * \brief Server DAV |
26 | 26 | */ |
27 | 27 | |
28 | -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); |
|
29 | -if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no menu to show |
|
30 | -if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
|
31 | -if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); |
|
32 | -if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged. |
|
33 | -if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. |
|
28 | +if (!defined('NOTOKENRENEWAL')) { |
|
29 | + define('NOTOKENRENEWAL', '1'); |
|
30 | +} |
|
31 | +if (!defined('NOREQUIREMENU')) { |
|
32 | + define('NOREQUIREMENU', '1'); |
|
33 | +} |
|
34 | +// If there is no menu to show |
|
35 | +if (!defined('NOREQUIREHTML')) { |
|
36 | + define('NOREQUIREHTML', '1'); |
|
37 | +} |
|
38 | +// If we don't need to load the html.form.class.php |
|
39 | +if (!defined('NOREQUIREAJAX')) { |
|
40 | + define('NOREQUIREAJAX', '1'); |
|
41 | +} |
|
42 | +if (!defined('NOLOGIN')) { |
|
43 | + define("NOLOGIN", 1); |
|
44 | +} |
|
45 | +// This means this output page does not require to be logged. |
|
46 | +if (!defined('NOCSRFCHECK')) { |
|
47 | + define("NOCSRFCHECK", 1); |
|
48 | +} |
|
49 | +// We accept to go on this page from external web site. |
|
34 | 50 | |
35 | 51 | require "../main.inc.php"; |
36 | 52 | require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
@@ -51,8 +67,9 @@ discard block |
||
51 | 67 | $langs->loadLangs(array("main", "other")); |
52 | 68 | |
53 | 69 | |
54 | -if (empty($conf->dav->enabled)) |
|
70 | +if (empty($conf->dav->enabled)) { |
|
55 | 71 | accessforbidden(); |
72 | +} |
|
56 | 73 | |
57 | 74 | |
58 | 75 | // Restrict API to some IPs |
@@ -104,12 +121,16 @@ discard block |
||
104 | 121 | } |
105 | 122 | |
106 | 123 | // Authentication mode |
107 | - if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication = 'dolibarr'; |
|
124 | + if (empty($dolibarr_main_authentication)) { |
|
125 | + $dolibarr_main_authentication = 'dolibarr'; |
|
126 | + } |
|
108 | 127 | |
109 | 128 | // Authentication mode: forceuser |
110 | 129 | if ($dolibarr_main_authentication == 'forceuser') |
111 | 130 | { |
112 | - if (empty($dolibarr_auto_user)) $dolibarr_auto_user = 'auto'; |
|
131 | + if (empty($dolibarr_auto_user)) { |
|
132 | + $dolibarr_auto_user = 'auto'; |
|
133 | + } |
|
113 | 134 | if ($dolibarr_auto_user != $username) |
114 | 135 | { |
115 | 136 | dol_syslog("Warning: your instance is set to use the automatic forced login '".$dolibarr_auto_user."' that is not the requested login. DAV usage is forbidden in this mode."); |
@@ -120,8 +141,9 @@ discard block |
||
120 | 141 | $authmode = explode(',', $dolibarr_main_authentication); |
121 | 142 | $entity = (GETPOST('entity', 'int') ? GETPOST('entity', 'int') : (!empty($conf->entity) ? $conf->entity : 1)); |
122 | 143 | |
123 | - if (checkLoginPassEntity($username, $password, $entity, $authmode, 'dav') != $username) |
|
124 | - return false; |
|
144 | + if (checkLoginPassEntity($username, $password, $entity, $authmode, 'dav') != $username) { |
|
145 | + return false; |
|
146 | + } |
|
125 | 147 | |
126 | 148 | return true; |
127 | 149 | }); |
@@ -175,7 +197,9 @@ discard block |
||
175 | 197 | // If you want to run the SabreDAV server in a custom location (using mod_rewrite for instance) |
176 | 198 | // You can override the baseUri here. |
177 | 199 | $baseUri = DOL_URL_ROOT.'/dav/fileserver.php/'; |
178 | -if (isset($baseUri)) $server->setBaseUri($baseUri); |
|
200 | +if (isset($baseUri)) { |
|
201 | + $server->setBaseUri($baseUri); |
|
202 | +} |
|
179 | 203 | |
180 | 204 | // Add authentication function |
181 | 205 | if ((empty($conf->global->DAV_ALLOW_PUBLIC_DIR) |
@@ -213,4 +237,6 @@ discard block |
||
213 | 237 | // And off we go! |
214 | 238 | $server->exec(); |
215 | 239 | |
216 | -if (is_object($db)) $db->close(); |
|
240 | +if (is_object($db)) { |
|
241 | + $db->close(); |
|
242 | +} |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | |
84 | 84 | // Authentication callback function |
85 | -$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password) { |
|
85 | +$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function($username, $password) { |
|
86 | 86 | global $user; |
87 | 87 | global $conf; |
88 | 88 | global $dolibarr_main_authentication, $dolibarr_auto_user; |
@@ -32,37 +32,37 @@ discard block |
||
32 | 32 | class modCron extends DolibarrModules |
33 | 33 | { |
34 | 34 | |
35 | - /** |
|
35 | + /** |
|
36 | 36 | * Constructor. Define names, constants, directories, boxes, permissions |
37 | 37 | * |
38 | 38 | * @param DoliDB $db Database handler |
39 | - */ |
|
40 | - public function __construct($db) |
|
41 | - { |
|
42 | - global $langs, $conf; |
|
39 | + */ |
|
40 | + public function __construct($db) |
|
41 | + { |
|
42 | + global $langs, $conf; |
|
43 | 43 | |
44 | - $this->db = $db; |
|
45 | - $this->numero = 2300; |
|
44 | + $this->db = $db; |
|
45 | + $this->numero = 2300; |
|
46 | 46 | |
47 | 47 | // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' |
48 | 48 | // It is used to group modules in module setup page |
49 | - $this->family = "base"; |
|
50 | - // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) |
|
51 | - $this->name = preg_replace('/^mod/i', '', get_class($this)); |
|
52 | - $this->description = "Enable the Dolibarr cron service"; |
|
49 | + $this->family = "base"; |
|
50 | + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) |
|
51 | + $this->name = preg_replace('/^mod/i', '', get_class($this)); |
|
52 | + $this->description = "Enable the Dolibarr cron service"; |
|
53 | 53 | // Possible values for version are: 'development', 'experimental', 'dolibarr' or version |
54 | - $this->version = 'dolibarr'; |
|
55 | - // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) |
|
56 | - $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); |
|
57 | - // Name of image file used for this module. |
|
58 | - $this->picto = 'technic'; |
|
54 | + $this->version = 'dolibarr'; |
|
55 | + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) |
|
56 | + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); |
|
57 | + // Name of image file used for this module. |
|
58 | + $this->picto = 'technic'; |
|
59 | 59 | |
60 | - // Data directories to create when module is enabled |
|
61 | - $this->dirs = array(); |
|
60 | + // Data directories to create when module is enabled |
|
61 | + $this->dirs = array(); |
|
62 | 62 | |
63 | - // Config pages |
|
64 | - //------------- |
|
65 | - $this->config_page_url = array("cron.php@cron"); |
|
63 | + // Config pages |
|
64 | + //------------- |
|
65 | + $this->config_page_url = array("cron.php@cron"); |
|
66 | 66 | |
67 | 67 | // Dependancies |
68 | 68 | //------------- |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | 0 |
86 | 86 | ),); |
87 | 87 | |
88 | - // New pages on tabs |
|
89 | - // ----------------- |
|
90 | - $this->tabs = array(); |
|
88 | + // New pages on tabs |
|
89 | + // ----------------- |
|
90 | + $this->tabs = array(); |
|
91 | 91 | |
92 | - // Boxes |
|
93 | - //------ |
|
94 | - $this->boxes = array(); |
|
92 | + // Boxes |
|
93 | + //------ |
|
94 | + $this->boxes = array(); |
|
95 | 95 | |
96 | 96 | // Cronjobs |
97 | 97 | $this->cronjobs = array( |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // 1=>array('entity'=>0, 'label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24) |
101 | 101 | ); |
102 | 102 | |
103 | - // Permissions |
|
103 | + // Permissions |
|
104 | 104 | $this->rights = array(); // Permission array used by this module |
105 | 105 | $this->rights_class = 'cron'; |
106 | 106 | $r = 0; |
@@ -129,18 +129,18 @@ discard block |
||
129 | 129 | $this->rights[$r][4] = 'execute'; |
130 | 130 | $r++; |
131 | 131 | |
132 | - // Main menu entries |
|
133 | - $r = 0; |
|
134 | - $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
135 | - 'type'=>'left', // This is a Left menu entry |
|
136 | - 'titre'=>'CronList', |
|
137 | - 'url'=>'/cron/list.php?leftmenu=admintools', |
|
138 | - 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
139 | - 'position'=>200, |
|
140 | - 'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
141 | - 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules |
|
142 | - 'target'=>'', |
|
143 | - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both |
|
144 | - $r++; |
|
145 | - } |
|
132 | + // Main menu entries |
|
133 | + $r = 0; |
|
134 | + $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
|
135 | + 'type'=>'left', // This is a Left menu entry |
|
136 | + 'titre'=>'CronList', |
|
137 | + 'url'=>'/cron/list.php?leftmenu=admintools', |
|
138 | + 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. |
|
139 | + 'position'=>200, |
|
140 | + 'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
141 | + 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules |
|
142 | + 'target'=>'', |
|
143 | + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both |
|
144 | + $r++; |
|
145 | + } |
|
146 | 146 | } |
@@ -167,7 +167,7 @@ |
||
167 | 167 | if ($key === 'count') |
168 | 168 | continue; |
169 | 169 | if (empty($userList[$userdn])) { // Récupération de l'utilisateur |
170 | - // Schéma rfc2307: les membres sont listés dans l'attribut memberUid sous form de login uniquement |
|
170 | + // Schéma rfc2307: les membres sont listés dans l'attribut memberUid sous form de login uniquement |
|
171 | 171 | if ($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS === 'memberUid') { |
172 | 172 | $userKey = array($userdn); |
173 | 173 | } else { // Pour les autres schémas, les membres sont listés sous forme de DN complets |
@@ -25,7 +25,9 @@ discard block |
||
25 | 25 | * \brief Script to update groups into Dolibarr from LDAP |
26 | 26 | */ |
27 | 27 | |
28 | -if (!defined('NOSESSION')) define('NOSESSION', '1'); |
|
28 | +if (!defined('NOSESSION')) { |
|
29 | + define('NOSESSION', '1'); |
|
30 | +} |
|
29 | 31 | |
30 | 32 | $sapi_type = php_sapi_name(); |
31 | 33 | $script_file = basename(__FILE__); |
@@ -72,15 +74,19 @@ discard block |
||
72 | 74 | } |
73 | 75 | |
74 | 76 | foreach ($argv as $key => $val) { |
75 | - if ($val == 'commitiferror') |
|
76 | - $forcecommit = 1; |
|
77 | - if (preg_match('/--server=([^\s]+)$/', $val, $reg)) |
|
78 | - $conf->global->LDAP_SERVER_HOST = $reg[1]; |
|
79 | - if (preg_match('/--excludeuser=([^\s]+)$/', $val, $reg)) |
|
80 | - $excludeuser = explode(',', $reg[1]); |
|
81 | - if (preg_match('/-y$/', $val, $reg)) |
|
82 | - $confirmed = 1; |
|
83 | -} |
|
77 | + if ($val == 'commitiferror') { |
|
78 | + $forcecommit = 1; |
|
79 | + } |
|
80 | + if (preg_match('/--server=([^\s]+)$/', $val, $reg)) { |
|
81 | + $conf->global->LDAP_SERVER_HOST = $reg[1]; |
|
82 | + } |
|
83 | + if (preg_match('/--excludeuser=([^\s]+)$/', $val, $reg)) { |
|
84 | + $excludeuser = explode(',', $reg[1]); |
|
85 | + } |
|
86 | + if (preg_match('/-y$/', $val, $reg)) { |
|
87 | + $confirmed = 1; |
|
88 | + } |
|
89 | + } |
|
84 | 90 | |
85 | 91 | print "Mails sending disabled (useless in batch mode)\n"; |
86 | 92 | $conf->global->MAIN_DISABLE_ALL_MAILS = 1; // On bloque les mails |
@@ -167,8 +173,9 @@ discard block |
||
167 | 173 | $userList = array(); |
168 | 174 | $userIdList = array(); |
169 | 175 | foreach ($ldapgroup[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] as $key => $userdn) { |
170 | - if ($key === 'count') |
|
171 | - continue; |
|
176 | + if ($key === 'count') { |
|
177 | + continue; |
|
178 | + } |
|
172 | 179 | if (empty($userList[$userdn])) { // Récupération de l'utilisateur |
173 | 180 | // Schéma rfc2307: les membres sont listés dans l'attribut memberUid sous form de login uniquement |
174 | 181 | if ($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS === 'memberUid') { |
@@ -177,8 +184,9 @@ discard block |
||
177 | 184 | $userFilter = explode(',', $userdn); |
178 | 185 | $userKey = $ldap->getAttributeValues('('.$userFilter[0].')', $conf->global->LDAP_KEY_USERS); |
179 | 186 | } |
180 | - if (!is_array($userKey)) |
|
181 | - continue; |
|
187 | + if (!is_array($userKey)) { |
|
188 | + continue; |
|
189 | + } |
|
182 | 190 | |
183 | 191 | $fuser = new User($db); |
184 | 192 | |
@@ -212,9 +220,11 @@ discard block |
||
212 | 220 | } |
213 | 221 | |
214 | 222 | if (!$error || $forcecommit) { |
215 | - if (!$error) |
|
216 | - print $langs->transnoentities("NoErrorCommitIsDone")."\n"; |
|
217 | - else print $langs->transnoentities("ErrorButCommitIsDone")."\n"; |
|
223 | + if (!$error) { |
|
224 | + print $langs->transnoentities("NoErrorCommitIsDone")."\n"; |
|
225 | + } else { |
|
226 | + print $langs->transnoentities("ErrorButCommitIsDone")."\n"; |
|
227 | + } |
|
218 | 228 | $db->commit(); |
219 | 229 | } else { |
220 | 230 | print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n"; |
@@ -114,9 +114,9 @@ |
||
114 | 114 | |
115 | 115 | dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); |
116 | 116 | |
117 | - print '<div class="fichecenter">'; |
|
117 | + print '<div class="fichecenter">'; |
|
118 | 118 | |
119 | - print '<div class="underbanner clearboth"></div>'; |
|
119 | + print '<div class="underbanner clearboth"></div>'; |
|
120 | 120 | print '<table class="border centpercent tableforfield">'; |
121 | 121 | |
122 | 122 | // Number of files |
@@ -54,8 +54,12 @@ discard block |
||
54 | 54 | $offset = $limit * $page; |
55 | 55 | $pageprev = $page - 1; |
56 | 56 | $pagenext = $page + 1; |
57 | -if (!$sortorder) $sortorder = "ASC"; |
|
58 | -if (!$sortfield) $sortfield = "name"; |
|
57 | +if (!$sortorder) { |
|
58 | + $sortorder = "ASC"; |
|
59 | +} |
|
60 | +if (!$sortfield) { |
|
61 | + $sortfield = "name"; |
|
62 | +} |
|
59 | 63 | //if (! $sortfield) $sortfield="position_name"; |
60 | 64 | |
61 | 65 | // Initialize technical objects |
@@ -70,7 +74,9 @@ discard block |
||
70 | 74 | include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
71 | 75 | |
72 | 76 | //if ($id > 0 || ! empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity?$object->entity:1] . "/bom/" . dol_sanitizeFileName($object->id); |
73 | -if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".dol_sanitizeFileName($object->ref); |
|
77 | +if ($id > 0 || !empty($ref)) { |
|
78 | + $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".dol_sanitizeFileName($object->ref); |
|
79 | +} |
|
74 | 80 | |
75 | 81 | |
76 | 82 | /* |
@@ -485,7 +485,7 @@ |
||
485 | 485 | if (($numerojour >= $jourAJ && $_SESSION["mois"] == $moisAJ && $_SESSION["annee"] == $anneeAJ) || ($_SESSION["mois"] > $moisAJ && $_SESSION["annee"] == $anneeAJ) || $_SESSION["annee"] > $anneeAJ) { |
486 | 486 | print '<td align="center" class="libre"><input type="submit" class="bouton ON" name="choixjourajout[]" value="'.$numerojour.'"></td>'."\n"; |
487 | 487 | } else { |
488 | - // grey button |
|
488 | + // grey button |
|
489 | 489 | print '<td align="center" class="avant">'.$numerojour.'</td>'."\n"; |
490 | 490 | } |
491 | 491 | } |
@@ -28,7 +28,9 @@ discard block |
||
28 | 28 | require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; |
29 | 29 | |
30 | 30 | // Security check |
31 | -if (!$user->rights->opensurvey->write) accessforbidden(); |
|
31 | +if (!$user->rights->opensurvey->write) { |
|
32 | + accessforbidden(); |
|
33 | +} |
|
32 | 34 | |
33 | 35 | // Survey type is DATE |
34 | 36 | $_SESSION["formatsondage"] = "D"; |
@@ -220,9 +222,15 @@ discard block |
||
220 | 222 | $anneeAJ = date("Y"); |
221 | 223 | |
222 | 224 | // Initialisation des jour, mois et année |
223 | -if (!isset($_SESSION['jour'])) $_SESSION['jour'] = date('j'); |
|
224 | -if (!isset($_SESSION['mois'])) $_SESSION['mois'] = date('n'); |
|
225 | -if (!isset($_SESSION['annee'])) $_SESSION['annee'] = date('Y'); |
|
225 | +if (!isset($_SESSION['jour'])) { |
|
226 | + $_SESSION['jour'] = date('j'); |
|
227 | +} |
|
228 | +if (!isset($_SESSION['mois'])) { |
|
229 | + $_SESSION['mois'] = date('n'); |
|
230 | +} |
|
231 | +if (!isset($_SESSION['annee'])) { |
|
232 | + $_SESSION['annee'] = date('Y'); |
|
233 | +} |
|
226 | 234 | |
227 | 235 | //mise a jour des valeurs de session si bouton retour a aujourd'hui |
228 | 236 | if (!issetAndNoEmpty('choixjourajout') && !issetAndNoEmpty('choixjourretrait') && (issetAndNoEmpty('retourmois') || issetAndNoEmpty('retourmois_x'))) { |
@@ -63,20 +63,20 @@ discard block |
||
63 | 63 | } |
64 | 64 | */ |
65 | 65 | |
66 | - // Show more tabs from modules |
|
67 | - // Entries must be declared in modules descriptor with line |
|
68 | - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
69 | - // $this->tabs = array('entity:-tabname); to remove a tab |
|
70 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock'); |
|
66 | + // Show more tabs from modules |
|
67 | + // Entries must be declared in modules descriptor with line |
|
68 | + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
69 | + // $this->tabs = array('entity:-tabname); to remove a tab |
|
70 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock'); |
|
71 | 71 | |
72 | - $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$object->id; |
|
72 | + $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$object->id; |
|
73 | 73 | $head[$h][1] = $langs->trans("Info"); |
74 | 74 | $head[$h][2] = 'info'; |
75 | 75 | $h++; |
76 | 76 | |
77 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'remove'); |
|
77 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'remove'); |
|
78 | 78 | |
79 | - return $head; |
|
79 | + return $head; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -86,28 +86,28 @@ discard block |
||
86 | 86 | */ |
87 | 87 | function stock_admin_prepare_head() |
88 | 88 | { |
89 | - global $langs, $conf, $user; |
|
89 | + global $langs, $conf, $user; |
|
90 | 90 | |
91 | - $h = 0; |
|
92 | - $head = array(); |
|
91 | + $h = 0; |
|
92 | + $head = array(); |
|
93 | 93 | |
94 | - $head[$h][0] = DOL_URL_ROOT.'/admin/stock.php'; |
|
95 | - $head[$h][1] = $langs->trans("Miscellaneous"); |
|
96 | - $head[$h][2] = 'general'; |
|
97 | - $h++; |
|
94 | + $head[$h][0] = DOL_URL_ROOT.'/admin/stock.php'; |
|
95 | + $head[$h][1] = $langs->trans("Miscellaneous"); |
|
96 | + $head[$h][2] = 'general'; |
|
97 | + $h++; |
|
98 | 98 | |
99 | - // Show more tabs from modules |
|
100 | - // Entries must be declared in modules descriptor with line |
|
101 | - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
102 | - // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
|
103 | - complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin'); |
|
99 | + // Show more tabs from modules |
|
100 | + // Entries must be declared in modules descriptor with line |
|
101 | + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
102 | + // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
|
103 | + complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin'); |
|
104 | 104 | |
105 | - $head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php'; |
|
106 | - $head[$h][1] = $langs->trans("ExtraFields"); |
|
107 | - $head[$h][2] = 'attributes'; |
|
108 | - $h++; |
|
105 | + $head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php'; |
|
106 | + $head[$h][1] = $langs->trans("ExtraFields"); |
|
107 | + $head[$h][2] = 'attributes'; |
|
108 | + $h++; |
|
109 | 109 | |
110 | - complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin', 'remove'); |
|
110 | + complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin', 'remove'); |
|
111 | 111 | |
112 | - return $head; |
|
112 | + return $head; |
|
113 | 113 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | function llxHeader() |
31 | 31 | { |
32 | - print '<html><title>Build an import example file</title><body>'; |
|
32 | + print '<html><title>Build an import example file</title><body>'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | function llxFooter() |
42 | 42 | { |
43 | - print '</body></html>'; |
|
43 | + print '</body></html>'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | require '../main.inc.php'; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * \brief Show example of import file |
22 | 22 | */ |
23 | 23 | |
24 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
24 | +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
25 | 25 | |
26 | 26 | |
27 | 27 | /** |
@@ -21,7 +21,10 @@ discard block |
||
21 | 21 | * \brief Show example of import file |
22 | 22 | */ |
23 | 23 | |
24 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
24 | +if (! defined('NOTOKENRENEWAL')) { |
|
25 | + define('NOTOKENRENEWAL', '1'); |
|
26 | +} |
|
27 | +// Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
25 | 28 | |
26 | 29 | |
27 | 30 | /** |
@@ -81,15 +84,23 @@ discard block |
||
81 | 84 | $valuestarget = $objimport->array_import_examplevalues[0]; |
82 | 85 | |
83 | 86 | $attachment = true; |
84 | -if (isset($_GET["attachment"])) $attachment = $_GET["attachment"]; |
|
87 | +if (isset($_GET["attachment"])) { |
|
88 | + $attachment = $_GET["attachment"]; |
|
89 | +} |
|
85 | 90 | //$attachment = false; |
86 | 91 | $contenttype = dol_mimetype($format); |
87 | -if (isset($_GET["contenttype"])) $contenttype = $_GET["contenttype"]; |
|
92 | +if (isset($_GET["contenttype"])) { |
|
93 | + $contenttype = $_GET["contenttype"]; |
|
94 | +} |
|
88 | 95 | //$contenttype='text/plain'; |
89 | 96 | $outputencoding = 'UTF-8'; |
90 | 97 | |
91 | -if ($contenttype) header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : '')); |
|
92 | -if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
98 | +if ($contenttype) { |
|
99 | + header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : '')); |
|
100 | +} |
|
101 | +if ($attachment) { |
|
102 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
103 | +} |
|
93 | 104 | |
94 | 105 | |
95 | 106 | // List of targets fields |
@@ -55,17 +55,17 @@ |
||
55 | 55 | var list = jQuery("#list"); |
56 | 56 | var totalizable = jQuery("#totalizable"); |
57 | 57 | <?php |
58 | - if ((GETPOST('type', 'alpha') != "select") && (GETPOST('type', 'alpha') != "sellist")) |
|
59 | - { |
|
60 | - print 'jQuery("#value_choice").hide();'; |
|
61 | - } |
|
58 | + if ((GETPOST('type', 'alpha') != "select") && (GETPOST('type', 'alpha') != "sellist")) |
|
59 | + { |
|
60 | + print 'jQuery("#value_choice").hide();'; |
|
61 | + } |
|
62 | 62 | |
63 | - if (GETPOST('type', 'alpha') == "separate") |
|
64 | - { |
|
63 | + if (GETPOST('type', 'alpha') == "separate") |
|
64 | + { |
|
65 | 65 | print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);"; |
66 | - print 'jQuery("#value_choice").hide();'; |
|
67 | - } |
|
68 | - ?> |
|
66 | + print 'jQuery("#value_choice").hide();'; |
|
67 | + } |
|
68 | + ?> |
|
69 | 69 | |
70 | 70 | // Case of computed field |
71 | 71 | if (type == '' || type == 'varchar' || type == 'int' || type == 'double' || type == 'price') { |