@@ -101,7 +101,7 @@ |
||
101 | 101 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON sp.fk_pays = co.rowid"; |
102 | 102 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; |
103 | 103 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
104 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
104 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
105 | 105 | } |
106 | 106 | if (empty($user->rights->societe->client->voir) && !$user->socid) { |
107 | 107 | $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
@@ -195,7 +195,7 @@ |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | // Security: Delete string ../ or ..\ into $original_file |
198 | -$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' |
|
198 | +$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' |
|
199 | 199 | $original_file = str_replace('../', '/', $original_file); |
200 | 200 | $original_file = str_replace('..\\', '/', $original_file); |
201 | 201 |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $object->ref = $ref; |
302 | 302 | $object->label = GETPOST('label', $label_security_check); |
303 | 303 | $object->price_base_type = GETPOST('price_base_type', 'aZ09'); |
304 | - $object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0; |
|
304 | + $object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0; |
|
305 | 305 | if ($object->price_base_type == 'TTC') { |
306 | 306 | $object->price_ttc = GETPOST('price'); |
307 | 307 | } else { |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | $object->oldcopy = clone $object; |
515 | 515 | |
516 | 516 | if (empty($conf->global->PRODUCT_GENERATE_REF_AFTER_FORM)) { |
517 | - $object->ref = $ref; |
|
517 | + $object->ref = $ref; |
|
518 | 518 | } |
519 | 519 | $object->label = GETPOST('label', $label_security_check); |
520 | 520 | |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | $object->accountancy_code_buy_export = $accountancy_code_buy_export; |
635 | 635 | } |
636 | 636 | if ($object->isService()) { |
637 | - $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ; |
|
637 | + $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0; |
|
638 | 638 | } |
639 | 639 | |
640 | 640 | |
@@ -1221,12 +1221,12 @@ discard block |
||
1221 | 1221 | if ($showbarcode) { |
1222 | 1222 | print '<tr><td>'.$langs->trans('BarcodeType').'</td><td>'; |
1223 | 1223 | if (GETPOSTISSET('fk_barcode_type')) { |
1224 | - $fk_barcode_type = GETPOST('fk_barcode_type')?GETPOST('fk_barcode_type'):0; |
|
1224 | + $fk_barcode_type = GETPOST('fk_barcode_type') ?GETPOST('fk_barcode_type') : 0; |
|
1225 | 1225 | } else { |
1226 | 1226 | if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) { |
1227 | 1227 | $fk_barcode_type = getDolGlobalInt("PRODUIT_DEFAULT_BARCODE_TYPE"); |
1228 | 1228 | } else { |
1229 | - $fk_barcode_type=0; |
|
1229 | + $fk_barcode_type = 0; |
|
1230 | 1230 | } |
1231 | 1231 | } |
1232 | 1232 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | // Default sort order (if not yet defined by previous GETPOST) |
85 | 85 | if (!$sortfield) { |
86 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
86 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
87 | 87 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
88 | 88 | } |
89 | 89 | if (!$sortorder) { |
@@ -156,14 +156,14 @@ discard block |
||
156 | 156 | if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && !empty($user->rights->eventorganization->write)) { |
157 | 157 | $project = new Project($db); |
158 | 158 | //If "set" fields keys is in projects fields |
159 | - $project_attr=preg_replace('/^set/', '', $action); |
|
159 | + $project_attr = preg_replace('/^set/', '', $action); |
|
160 | 160 | if (array_key_exists($project_attr, $project->fields)) { |
161 | 161 | $result = $project->fetch($projectid, $projectref); |
162 | 162 | if ($result < 0) { |
163 | 163 | setEventMessages(null, $project->errors, 'errors'); |
164 | 164 | } else { |
165 | - $project->{$project_attr}=GETPOST($project_attr); |
|
166 | - $result=$project->update($user); |
|
165 | + $project->{$project_attr} = GETPOST($project_attr); |
|
166 | + $result = $project->update($user); |
|
167 | 167 | if ($result < 0) { |
168 | 168 | setEventMessages(null, $project->errors, 'errors'); |
169 | 169 | } |
@@ -253,9 +253,9 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; |
256 | - $title = $langs->trans("Project") . ' - ' . $langs->trans("ListOfConferencesOrBooths") . ' - ' . $project->ref . ' ' . $project->name; |
|
256 | + $title = $langs->trans("Project").' - '.$langs->trans("ListOfConferencesOrBooths").' - '.$project->ref.' '.$project->name; |
|
257 | 257 | if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $project->name) { |
258 | - $title = $project->ref . ' ' . $project->name . ' - ' . $langs->trans("ListOfConferencesOrBooths"); |
|
258 | + $title = $project->ref.' '.$project->name.' - '.$langs->trans("ListOfConferencesOrBooths"); |
|
259 | 259 | } |
260 | 260 | } |
261 | 261 | |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; |
534 | 534 | } |
535 | 535 | if (preg_match('/_dtend$/', $key)) { |
536 | - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; |
|
536 | + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; |
|
537 | 537 | } |
538 | 538 | } |
539 | 539 | } |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | } |
633 | 633 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
634 | 634 | |
635 | -print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($projectid)?'?projectid='.$projectid:'').'">'."\n"; |
|
635 | +print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($projectid) ? '?projectid='.$projectid : '').'">'."\n"; |
|
636 | 636 | if ($optioncss != '') { |
637 | 637 | print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
638 | 638 | } |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | |
647 | 647 | $title = $langs->trans("ListOfConferencesOrBooths"); |
648 | 648 | |
649 | -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?action=create'.(!empty($project->id)?'&withproject=1&fk_project='.$project->id:'').(!empty($project->socid)?'&fk_soc='.$project->socid:'').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id)?'?projectid='.$project->id:''), '', $permissiontoadd); |
|
649 | +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?action=create'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id) ? '?projectid='.$project->id : ''), '', $permissiontoadd); |
|
650 | 650 | |
651 | 651 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
652 | 652 | |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">'; |
713 | 713 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
714 | 714 | print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $searchkey, $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); |
715 | - } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { |
|
715 | + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { |
|
716 | 716 | print $object->showInputField($val, $key, $searchkey, '', '', 'search_', 'maxwidth125', 1); |
717 | 717 | } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
718 | 718 | print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($searchkey).'">'; |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | if ($key == 'status') { |
822 | 822 | print $object->getLibStatut(5); |
823 | 823 | } elseif ($key == 'ref') { |
824 | - print $object->getNomUrl(1, 0, '', (($projectid > 0)?'withproject':'')); |
|
824 | + print $object->getNomUrl(1, 0, '', (($projectid > 0) ? 'withproject' : '')); |
|
825 | 825 | } else { |
826 | 826 | print $object->showOutputField($val, $key, $object->$key, ''); |
827 | 827 | } |
@@ -601,15 +601,15 @@ |
||
601 | 601 | if (empty($reshook)) { |
602 | 602 | // Send |
603 | 603 | if (empty($user->socid)) { |
604 | - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); |
|
604 | + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id) ? '&conforboothid='.$confOrBooth->id : '').(!empty($projectstatic->id) ? '&fk_project='.$projectstatic->id : '').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); |
|
605 | 605 | } |
606 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
606 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id) ? '&conforboothid='.$confOrBooth->id : '').(!empty($projectstatic->id) ? '&fk_project='.$projectstatic->id : '').'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
607 | 607 | |
608 | 608 | // Clone |
609 | - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd); |
|
609 | + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id) ? '&fk_project='.$projectstatic->id : ''), '', $permissiontoadd); |
|
610 | 610 | |
611 | 611 | // Delete (need delete permission, or if draft, just need create/modify permission) |
612 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
612 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id) ? '&fk_project='.$projectstatic->id : ''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
613 | 613 | } |
614 | 614 | print '</div>'."\n"; |
615 | 615 | } |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $upload_dir = $conf->don->dir_output.'/'.get_exdir($filename, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref); |
81 | 81 | $modulepart = 'don'; |
82 | 82 | |
83 | -$permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php |
|
83 | +$permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php |
|
84 | 84 | |
85 | 85 | |
86 | 86 | /* |
@@ -60,7 +60,7 @@ |
||
60 | 60 | || (($user->id != $id) && $user->rights->user->user->password)); |
61 | 61 | } |
62 | 62 | |
63 | -$permissiontoadd = $caneditfield; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
63 | +$permissiontoadd = $caneditfield; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
64 | 64 | $permtoedit = $caneditfield; |
65 | 65 | |
66 | 66 | // Security check |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $upload_dir = $conf->ticket->dir_output."/".dol_sanitizeFileName($object->ref); |
71 | 71 | } |
72 | 72 | |
73 | -$permissiontoadd = $user->rights->ticket->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
73 | +$permissiontoadd = $user->rights->ticket->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
74 | 74 | |
75 | 75 | // Security check - Protection if external user |
76 | 76 | $result = restrictedArea($user, 'ticket', $object->id); |
@@ -91,7 +91,7 @@ |
||
91 | 91 | } |
92 | 92 | $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission |
93 | 93 | |
94 | -$permissiontoadd = $user->rights->societe->contact->creer; // Used by the include of actions_dellink.inc.php |
|
94 | +$permissiontoadd = $user->rights->societe->contact->creer; // Used by the include of actions_dellink.inc.php |
|
95 | 95 | |
96 | 96 | |
97 | 97 | /* |