@@ -76,12 +76,20 @@ |
||
| 76 | 76 | $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1]; |
| 77 | 77 | |
| 78 | 78 | // Security check (enable the most restrictive one) |
| 79 | -if ($user->socid > 0) accessforbidden(); |
|
| 80 | -if ($user->socid > 0) $socid = $user->socid; |
|
| 79 | +if ($user->socid > 0) { |
|
| 80 | + accessforbidden(); |
|
| 81 | +} |
|
| 82 | +if ($user->socid > 0) { |
|
| 83 | + $socid = $user->socid; |
|
| 84 | +} |
|
| 81 | 85 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 82 | 86 | restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 83 | -if (!isModEnabled('asset')) accessforbidden(); |
|
| 84 | -if (!$permissiontoread) accessforbidden(); |
|
| 87 | +if (!isModEnabled('asset')) { |
|
| 88 | + accessforbidden(); |
|
| 89 | +} |
|
| 90 | +if (!$permissiontoread) { |
|
| 91 | + accessforbidden(); |
|
| 92 | +} |
|
| 85 | 93 | |
| 86 | 94 | |
| 87 | 95 | /* |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // Load Dolibarr environment |
| 26 | 26 | require '../../main.inc.php'; |
| 27 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/asset.lib.php'; |
|
| 28 | -require_once DOL_DOCUMENT_ROOT . '/asset/class/assetmodel.class.php'; |
|
| 29 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 27 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; |
|
| 28 | +require_once DOL_DOCUMENT_ROOT.'/asset/class/assetmodel.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 31 | 31 | |
| 32 | 32 | // Load translation files required by the page |
| 33 | 33 | $langs->loadLangs(array("assets", "other")); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | // Initialize technical objects |
| 46 | 46 | $object = new AssetModel($db); |
| 47 | 47 | $extrafields = new ExtraFields($db); |
| 48 | -$diroutputmassaction = $conf->asset->dir_output . '/temp/massgeneration/' . $user->id; |
|
| 48 | +$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; |
|
| 49 | 49 | $hookmanager->initHooks(array('assetmodelcard', 'globalcard')); // Note that conf->hooks_modules contains array |
| 50 | 50 | |
| 51 | 51 | // Fetch optionals attributes and labels |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | $search_all = GETPOST("search_all", 'alpha'); |
| 58 | 58 | $search = array(); |
| 59 | 59 | foreach ($object->fields as $key => $val) { |
| 60 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
| 61 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 60 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
| 61 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // Load object |
| 70 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 70 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 71 | 71 | |
| 72 | 72 | $permissiontoread = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read'))); |
| 73 | 73 | $permissiontoadd = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
@@ -98,14 +98,14 @@ discard block |
||
| 98 | 98 | if (empty($reshook)) { |
| 99 | 99 | $error = 0; |
| 100 | 100 | |
| 101 | - $backurlforlist = DOL_URL_ROOT . '/asset/model/list.php'; |
|
| 101 | + $backurlforlist = DOL_URL_ROOT.'/asset/model/list.php'; |
|
| 102 | 102 | |
| 103 | 103 | if (empty($backtopage) || ($cancel && empty($id))) { |
| 104 | 104 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
| 105 | 105 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 106 | 106 | $backtopage = $backurlforlist; |
| 107 | 107 | } else { |
| 108 | - $backtopage = DOL_URL_ROOT . '/asset/model/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__'); |
|
| 108 | + $backtopage = DOL_URL_ROOT.'/asset/model/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen |
| 124 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
| 124 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
@@ -134,22 +134,22 @@ discard block |
||
| 134 | 134 | $form = new Form($db); |
| 135 | 135 | $formfile = new FormFile($db); |
| 136 | 136 | |
| 137 | -$title = $langs->trans("AssetModel") . ' - ' . $langs->trans("Card"); |
|
| 137 | +$title = $langs->trans("AssetModel").' - '.$langs->trans("Card"); |
|
| 138 | 138 | $help_url = ''; |
| 139 | 139 | llxHeader('', $title, $help_url); |
| 140 | 140 | |
| 141 | 141 | // Part to create |
| 142 | 142 | if ($action == 'create') { |
| 143 | - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("AssetModel")), '', 'object_' . $object->picto); |
|
| 143 | + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("AssetModel")), '', 'object_'.$object->picto); |
|
| 144 | 144 | |
| 145 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 146 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 145 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 146 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 147 | 147 | print '<input type="hidden" name="action" value="add">'; |
| 148 | 148 | if ($backtopage) { |
| 149 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 149 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 150 | 150 | } |
| 151 | 151 | if ($backtopageforcancel) { |
| 152 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 152 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | print dol_get_fiche_head(array(), ''); |
@@ -157,15 +157,15 @@ discard block |
||
| 157 | 157 | // Set some default values |
| 158 | 158 | //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; |
| 159 | 159 | |
| 160 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
| 160 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
| 161 | 161 | |
| 162 | 162 | // Common attributes |
| 163 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
| 163 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
| 164 | 164 | |
| 165 | 165 | // Other attributes |
| 166 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
| 166 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
| 167 | 167 | |
| 168 | - print '</table>' . "\n"; |
|
| 168 | + print '</table>'."\n"; |
|
| 169 | 169 | |
| 170 | 170 | print dol_get_fiche_end(); |
| 171 | 171 | |
@@ -178,28 +178,28 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | // Part to edit record |
| 180 | 180 | if (($id || $ref) && $action == 'edit') { |
| 181 | - print load_fiche_titre($langs->trans("AssetModel"), '', 'object_' . $object->picto); |
|
| 181 | + print load_fiche_titre($langs->trans("AssetModel"), '', 'object_'.$object->picto); |
|
| 182 | 182 | |
| 183 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 184 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 183 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 184 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 185 | 185 | print '<input type="hidden" name="action" value="update">'; |
| 186 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 186 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 187 | 187 | if ($backtopage) { |
| 188 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 188 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 189 | 189 | } |
| 190 | 190 | if ($backtopageforcancel) { |
| 191 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 191 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | print dol_get_fiche_head(); |
| 195 | 195 | |
| 196 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
| 196 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
| 197 | 197 | |
| 198 | 198 | // Common attributes |
| 199 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
| 199 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
| 200 | 200 | |
| 201 | 201 | // Other attributes |
| 202 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
| 202 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
| 203 | 203 | |
| 204 | 204 | print '</table>'; |
| 205 | 205 | |
@@ -221,12 +221,12 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | // Confirmation to delete |
| 223 | 223 | if ($action == 'delete') { |
| 224 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteAssetModel'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 224 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteAssetModel'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 225 | 225 | } elseif ($action == 'clone') { |
| 226 | 226 | // Clone confirmation |
| 227 | 227 | // Create an array for form |
| 228 | 228 | $formquestion = array(); |
| 229 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
|
| 229 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | // Call Hook formConfirm |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | // Object card |
| 246 | 246 | // ------------------------------------------------------------ |
| 247 | - $linkback = '<a href="' . DOL_URL_ROOT . '/asset/model/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 247 | + $linkback = '<a href="'.DOL_URL_ROOT.'/asset/model/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 248 | 248 | |
| 249 | 249 | $morehtmlref = '<div class="refidno">'; |
| 250 | 250 | $morehtmlref .= '</div>'; |
@@ -256,13 +256,13 @@ discard block |
||
| 256 | 256 | print '<div class="fichecenter">'; |
| 257 | 257 | print '<div class="fichehalfleft">'; |
| 258 | 258 | print '<div class="underbanner clearboth"></div>'; |
| 259 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
| 259 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
| 260 | 260 | |
| 261 | 261 | // Common attributes |
| 262 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
| 262 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
| 263 | 263 | |
| 264 | 264 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
| 265 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 265 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 266 | 266 | |
| 267 | 267 | print '</table>'; |
| 268 | 268 | print '</div>'; |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | |
| 276 | 276 | // Buttons for actions |
| 277 | 277 | if ($action != 'editline') { |
| 278 | - print '<div class="tabsAction">' . "\n"; |
|
| 278 | + print '<div class="tabsAction">'."\n"; |
|
| 279 | 279 | $parameters = array(); |
| 280 | 280 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 281 | 281 | if ($reshook < 0) { |
@@ -284,16 +284,16 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | if (empty($reshook)) { |
| 286 | 286 | if ($object->status == $object::STATUS_DRAFT) { |
| 287 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
| 287 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | // Back to draft |
| 291 | 291 | if ($object->status != $object::STATUS_DRAFT) { |
| 292 | - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
| 292 | + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | if ($object->status != $object::STATUS_VALIDATED) { |
| 296 | - print dolGetButtonAction($langs->trans('Enable'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=confirm_validate&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
| 296 | + print dolGetButtonAction($langs->trans('Enable'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | if ($object->status != $object::STATUS_CANCELED) { |
@@ -301,12 +301,12 @@ discard block |
||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | // Clone |
| 304 | - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . (!empty($socid) ? '&socid=' . $socid : '') . '&action=clone&token=' . newToken(), '', $permissiontoadd); |
|
| 304 | + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($socid) ? '&socid='.$socid : '').'&action=clone&token='.newToken(), '', $permissiontoadd); |
|
| 305 | 305 | |
| 306 | 306 | // Delete (need delete permission, or if draft, just need create/modify permission) |
| 307 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
| 307 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
| 308 | 308 | } |
| 309 | - print '</div>' . "\n"; |
|
| 309 | + print '</div>'."\n"; |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
@@ -130,12 +130,20 @@ |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // Security check (enable the most restrictive one) |
| 133 | -if ($user->socid > 0) accessforbidden(); |
|
| 134 | -$socid = 0; if ($user->socid > 0) $socid = $user->socid; |
|
| 133 | +if ($user->socid > 0) { |
|
| 134 | + accessforbidden(); |
|
| 135 | +} |
|
| 136 | +$socid = 0; if ($user->socid > 0) { |
|
| 137 | + $socid = $user->socid; |
|
| 138 | +} |
|
| 135 | 139 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 136 | 140 | restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 137 | -if (!isModEnabled('asset')) accessforbidden(); |
|
| 138 | -if (!$permissiontoread) accessforbidden(); |
|
| 141 | +if (!isModEnabled('asset')) { |
|
| 142 | + accessforbidden(); |
|
| 143 | +} |
|
| 144 | +if (!$permissiontoread) { |
|
| 145 | + accessforbidden(); |
|
| 146 | +} |
|
| 139 | 147 | |
| 140 | 148 | |
| 141 | 149 | |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? |
| 40 | 40 | $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation |
| 41 | 41 | $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button |
| 42 | -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
| 42 | +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
| 43 | 43 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'assetlist'; // To manage different context of search |
| 44 | 44 | $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page |
| 45 | -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') |
|
| 46 | -$mode = GETPOST('mode', 'alpha'); // mode view (kanban or common) |
|
| 45 | +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') |
|
| 46 | +$mode = GETPOST('mode', 'alpha'); // mode view (kanban or common) |
|
| 47 | 47 | $id = GETPOST('id', 'int'); |
| 48 | 48 | |
| 49 | 49 | // Load variable for pagination |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // Default sort order (if not yet defined by previous GETPOST) |
| 74 | 74 | if (!$sortfield) { |
| 75 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
| 75 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
| 76 | 76 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
| 77 | 77 | } |
| 78 | 78 | if (!$sortorder) { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; |
| 257 | 257 | } |
| 258 | 258 | if (preg_match('/_dtend$/', $key)) { |
| 259 | - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; |
|
| 259 | + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; |
|
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | } |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | $arraykeyvalue = array(); |
| 126 | 126 | foreach ($accountingcategory->lines_cptbk as $key => $val) { |
| 127 | 127 | $doc_ref = !empty($val->doc_ref) ? $val->doc_ref : ''; |
| 128 | - $arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . ($doc_ref ? ' '.$doc_ref : ''); |
|
| 128 | + $arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte).' - '.$val->label_compte.($doc_ref ? ' '.$doc_ref : ''); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) { |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | $type = $object->type; |
| 58 | 58 | if (is_numeric($type)) { |
| 59 | - $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility |
|
| 59 | + $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | // Get parameters |
| 49 | 49 | $action = GETPOST('action', 'aZ09'); |
| 50 | -$search_prod = GETPOST('search_prod', 'alpha'); |
|
| 50 | +$search_prod = GETPOST('search_prod', 'alpha'); |
|
| 51 | 51 | $cancel = GETPOST('cancel', 'alpha'); |
| 52 | 52 | $search_label = GETPOST('search_label', 'alpha'); |
| 53 | 53 | $search_price = GETPOST('search_price'); |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'); |
| 68 | 68 | $cancel = GETPOST('cancel', 'alpha'); |
| 69 | 69 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 70 | -$confirm = GETPOST('confirm'); |
|
| 70 | +$confirm = GETPOST('confirm'); |
|
| 71 | 71 | $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); |
| 72 | 72 | |
| 73 | 73 | if ($user->socid) { |
@@ -52,10 +52,10 @@ |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Sort & Order fields |
| 55 | -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; |
|
| 55 | +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; |
|
| 56 | 56 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 57 | 57 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 58 | -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
| 58 | +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
| 59 | 59 | $optioncss = GETPOST('optioncss', 'alpha'); |
| 60 | 60 | |
| 61 | 61 | if (empty($page) || $page == -1) { |
@@ -39,21 +39,21 @@ |
||
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | // Get parameters |
| 42 | -$action = GETPOST('action', 'aZ09'); |
|
| 43 | -$confirm = GETPOST('confirm'); |
|
| 44 | -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); |
|
| 45 | -$ref = GETPOST('ref', 'alpha'); |
|
| 42 | +$action = GETPOST('action', 'aZ09'); |
|
| 43 | +$confirm = GETPOST('confirm'); |
|
| 44 | +$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); |
|
| 45 | +$ref = GETPOST('ref', 'alpha'); |
|
| 46 | 46 | |
| 47 | -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; |
|
| 47 | +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; |
|
| 48 | 48 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 49 | 49 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 50 | -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
| 50 | +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
| 51 | 51 | |
| 52 | 52 | if (empty($page) || $page == -1) { |
| 53 | 53 | $page = 0; |
| 54 | 54 | } // If $page is not defined, or '' or -1 |
| 55 | 55 | |
| 56 | -$offset = $limit * $page; |
|
| 56 | +$offset = $limit * $page; |
|
| 57 | 57 | $pageprev = $page - 1; |
| 58 | 58 | $pagenext = $page + 1; |
| 59 | 59 | |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | */ |
| 96 | 96 | |
| 97 | 97 | $parameters = array('id'=>$id); |
| 98 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 98 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 99 | 99 | if ($reshook < 0) { |
| 100 | 100 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 101 | 101 | } |