| @@ -27,10 +27,10 @@ discard block | ||
| 27 | 27 | |
| 28 | 28 | // Load Dolibarr environment | 
| 29 | 29 | require '../main.inc.php'; | 
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; | |
| 31 | -require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php'; | |
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; | |
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; | |
| 31 | +require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; | |
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; | |
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; | |
| 34 | 34 | |
| 35 | 35 | /** | 
| 36 | 36 | * @var Conf $conf | 
| @@ -83,14 +83,14 @@ discard block | ||
| 83 | 83 |  $hookmanager->initHooks(array('orderagenda', 'globalcard')); | 
| 84 | 84 | |
| 85 | 85 | // Load object | 
| 86 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals | |
| 86 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals | |
| 87 | 87 |  if ($id > 0 || !empty($ref)) { | 
| 88 | - $upload_dir = $conf->order->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity] . "/" . $object->id; | |
| 88 | + $upload_dir = $conf->order->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; | |
| 89 | 89 | } | 
| 90 | 90 | |
| 91 | 91 | // Security check | 
| 92 | 92 |  if ($user->socid > 0) { | 
| 93 | - $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of order and assignment. | |
| 93 | + $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of order and assignment. | |
| 94 | 94 | } | 
| 95 | 95 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); | 
| 96 | 96 | restrictedArea($user, 'commande', $id, '', '', 'fk_soc', 'rowid', $isdraft); | 
| @@ -137,10 +137,10 @@ discard block | ||
| 137 | 137 | |
| 138 | 138 | $form = new Form($db); | 
| 139 | 139 | |
| 140 | -$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : ''; | |
| 141 | -$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Removed $object->name as orders typically don't have it | |
| 140 | +$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; | |
| 141 | +$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Removed $object->name as orders typically don't have it | |
| 142 | 142 |  if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/ordernamonly/', getDolGlobalString('MAIN_HTML_TITLE'))) { | 
| 143 | -	$title = $object->ref . ' - ' . $langs->trans("Info"); // Simplified title | |
| 143 | +	$title = $object->ref.' - '.$langs->trans("Info"); // Simplified title | |
| 144 | 144 | } | 
| 145 | 145 | $help_url = "EN:Module_Orders|FR:Module_Commandes|ES:Módulo_Pedidos"; | 
| 146 | 146 |  llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_messaging'); | 
| @@ -155,9 +155,9 @@ discard block | ||
| 155 | 155 |  if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['order'])) { | 
| 156 | 156 | $tmpurl = $_SESSION['pageforbacktolist']['order']; | 
| 157 | 157 |  	$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); | 
| 158 | -	$linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 158 | +	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 159 | 159 |  } else { | 
| 160 | -	$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 160 | +	$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 161 | 161 | } | 
| 162 | 162 | |
| 163 | 163 | $morehtmlref = '<div class="refidno">'; | 
| @@ -165,7 +165,7 @@ discard block | ||
| 165 | 165 | $morehtmlref .= $object->ref; | 
| 166 | 166 | // Thirdparty | 
| 167 | 167 |  if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { | 
| 168 | - $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'order'); | |
| 168 | + $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'order'); | |
| 169 | 169 | } | 
| 170 | 170 | $morehtmlref .= '</div>'; | 
| 171 | 171 | |
| @@ -198,7 +198,7 @@ discard block | ||
| 198 | 198 | $out = ''; | 
| 199 | 199 |  $permok = $user->hasRight('agenda', 'myactions', 'create'); | 
| 200 | 200 |  if ($permok) { | 
| 201 | - $out .= '&orderid=' . $object->id; | |
| 201 | + $out .= '&orderid='.$object->id; | |
| 202 | 202 | } | 
| 203 | 203 | |
| 204 | 204 | |
| @@ -213,11 +213,11 @@ discard block | ||
| 213 | 213 | |
| 214 | 214 | |
| 215 | 215 | // Show link to change view in message | 
| 216 | - $messagingUrl = DOL_URL_ROOT . '/commande/messaging.php?id=' . $object->id; | |
| 216 | + $messagingUrl = DOL_URL_ROOT.'/commande/messaging.php?id='.$object->id; | |
| 217 | 217 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2); | 
| 218 | 218 | |
| 219 | 219 | // Show link to change view in agenda | 
| 220 | - $messagingUrl = DOL_URL_ROOT . '/commande/agenda.php?id=' . $object->id; | |
| 220 | + $messagingUrl = DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id; | |
| 221 | 221 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); | 
| 222 | 222 | |
| 223 | 223 | |
| @@ -234,24 +234,24 @@ discard block | ||
| 234 | 234 | // Show link to add event | 
| 235 | 235 |  	if (isModEnabled('agenda')) { | 
| 236 | 236 |  		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); | 
| 237 | -		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); | |
| 237 | +		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); | |
| 238 | 238 | } | 
| 239 | 239 | |
| 240 | - $param = '&id=' . $object->id; | |
| 240 | + $param = '&id='.$object->id; | |
| 241 | 241 |  	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { | 
| 242 | - $param .= '&contextpage=' . urlencode($contextpage); | |
| 242 | + $param .= '&contextpage='.urlencode($contextpage); | |
| 243 | 243 | } | 
| 244 | 244 |  	if ($limit > 0 && $limit != $conf->liste_limit) { | 
| 245 | - $param .= '&limit=' . ((int) $limit); | |
| 245 | + $param .= '&limit='.((int) $limit); | |
| 246 | 246 | } | 
| 247 | 247 | |
| 248 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; | |
| 249 | - $cachekey = 'count_events_order_' . $object->id; | |
| 248 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; | |
| 249 | + $cachekey = 'count_events_order_'.$object->id; | |
| 250 | 250 | $nbEvent = dol_getcache($cachekey); | 
| 251 | 251 | |
| 252 | -	$titlelist = $langs->trans("ActionsOnOrder") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 252 | +	$titlelist = $langs->trans("ActionsOnOrder").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 253 | 253 |  	if (!empty($conf->dol_optimize_smallscreen)) { | 
| 254 | -		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 254 | +		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 255 | 255 | } | 
| 256 | 256 | |
| 257 | 257 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); | 
| @@ -27,12 +27,12 @@ discard block | ||
| 27 | 27 | |
| 28 | 28 | // Load Dolibarr environment | 
| 29 | 29 | require '../main.inc.php'; | 
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; | |
| 31 | -require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; // Added for contact object | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; | |
| 33 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; // Keep if you use project linking in order | |
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php'; | |
| 35 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; | |
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; | |
| 31 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Added for contact object | |
| 32 | +require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; | |
| 33 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Keep if you use project linking in order | |
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; | |
| 35 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; | |
| 36 | 36 | |
| 37 | 37 | /** | 
| 38 | 38 | * @var Conf $conf | 
| @@ -83,9 +83,9 @@ discard block | ||
| 83 | 83 |  $hookmanager->initHooks(array('orderagenda', 'globalcard')); | 
| 84 | 84 | |
| 85 | 85 | // Load object | 
| 86 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals | |
| 86 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals | |
| 87 | 87 |  if ($id > 0 || !empty($ref)) { | 
| 88 | - $upload_dir = $conf->order->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity] . "/" . $object->id; | |
| 88 | + $upload_dir = $conf->order->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; | |
| 89 | 89 | } | 
| 90 | 90 | |
| 91 | 91 | // Security check | 
| @@ -136,11 +136,11 @@ discard block | ||
| 136 | 136 | */ | 
| 137 | 137 | |
| 138 | 138 | $form = new Form($db); | 
| 139 | -$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : ''; | |
| 140 | -$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; | |
| 139 | +$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; | |
| 140 | +$title = $langs->trans('Events').$agenda.' - '.$object->ref; | |
| 141 | 141 | |
| 142 | 142 |  if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/ordernamonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { | 
| 143 | -	$title = $object->ref . ' - ' . $langs->trans("Info"); // Simplified title | |
| 143 | +	$title = $object->ref.' - '.$langs->trans("Info"); // Simplified title | |
| 144 | 144 | } | 
| 145 | 145 | $help_url = "EN:Module_Orders|FR:Module_Commandes|ES:Módulo_Pedidos"; | 
| 146 | 146 |  llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_agenda'); | 
| @@ -155,9 +155,9 @@ discard block | ||
| 155 | 155 |  if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['order'])) { | 
| 156 | 156 | $tmpurl = $_SESSION['pageforbacktolist']['order']; | 
| 157 | 157 |  	$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); | 
| 158 | -	$linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 158 | +	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 159 | 159 |  } else { | 
| 160 | -	$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 160 | +	$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 161 | 161 | } | 
| 162 | 162 | |
| 163 | 163 | $morehtmlref = '<div class="refidno">'; | 
| @@ -165,7 +165,7 @@ discard block | ||
| 165 | 165 |  $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); | 
| 166 | 166 |  $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); | 
| 167 | 167 | // Thirdparty | 
| 168 | -$morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1); | |
| 168 | +$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1); | |
| 169 | 169 | // Project | 
| 170 | 170 |  if (isModEnabled('project')) { | 
| 171 | 171 |  	$langs->load("projects"); | 
| @@ -173,16 +173,16 @@ discard block | ||
| 173 | 173 |  	if (0) {	// @phpstan-ignore-line | 
| 174 | 174 |  		$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); | 
| 175 | 175 |  		if ($action != 'classify') { | 
| 176 | -			$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; | |
| 176 | +			$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> '; | |
| 177 | 177 | } | 
| 178 | - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); | |
| 178 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); | |
| 179 | 179 |  	} else { | 
| 180 | 180 |  		if (!empty($object->fk_project)) { | 
| 181 | 181 | $proj = new Project($db); | 
| 182 | 182 | $proj->fetch($object->fk_project); | 
| 183 | 183 | $morehtmlref .= $proj->getNomUrl(1); | 
| 184 | 184 |  			if ($proj->title) { | 
| 185 | - $morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>'; | |
| 185 | + $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>'; | |
| 186 | 186 | } | 
| 187 | 187 | } | 
| 188 | 188 | } | 
| @@ -214,7 +214,7 @@ discard block | ||
| 214 | 214 | $out = ''; | 
| 215 | 215 |  $permok = $user->hasRight('agenda', 'myactions', 'create'); | 
| 216 | 216 |  if ($permok) { | 
| 217 | - $out .= '&orderid=' . $object->id; | |
| 217 | + $out .= '&orderid='.$object->id; | |
| 218 | 218 | } | 
| 219 | 219 | |
| 220 | 220 | |
| @@ -228,35 +228,35 @@ discard block | ||
| 228 | 228 | $morehtmlright = ''; | 
| 229 | 229 | |
| 230 | 230 | // Show link to change view in message | 
| 231 | - $messagingUrl = DOL_URL_ROOT . '/commande/messaging.php?id=' . $object->id; | |
| 231 | + $messagingUrl = DOL_URL_ROOT.'/commande/messaging.php?id='.$object->id; | |
| 232 | 232 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); // Status 1 for "not current page" | 
| 233 | 233 | |
| 234 | 234 | |
| 235 | 235 | // Show link to change view in agenda | 
| 236 | - $messagingUrl = DOL_URL_ROOT . '/commande/agenda.php?id=' . $object->id; | |
| 236 | + $messagingUrl = DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id; | |
| 237 | 237 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); // Status 2 for "current page" | 
| 238 | 238 | |
| 239 | 239 | // Show link to add event | 
| 240 | 240 |  	if (isModEnabled('agenda')) { | 
| 241 | 241 |  		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); | 
| 242 | -		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); | |
| 242 | +		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); | |
| 243 | 243 | } | 
| 244 | 244 | |
| 245 | - $param = '&id=' . $object->id; | |
| 245 | + $param = '&id='.$object->id; | |
| 246 | 246 |  	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { | 
| 247 | - $param .= '&contextpage=' . urlencode($contextpage); | |
| 247 | + $param .= '&contextpage='.urlencode($contextpage); | |
| 248 | 248 | } | 
| 249 | 249 |  	if ($limit > 0 && $limit != $conf->liste_limit) { | 
| 250 | - $param .= '&limit=' . ((int) $limit); | |
| 250 | + $param .= '&limit='.((int) $limit); | |
| 251 | 251 | } | 
| 252 | 252 | |
| 253 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; | |
| 254 | - $cachekey = 'count_events_commande_' . $object->id; | |
| 253 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; | |
| 254 | + $cachekey = 'count_events_commande_'.$object->id; | |
| 255 | 255 | $nbEvent = dol_getcache($cachekey); | 
| 256 | 256 | |
| 257 | -	$titlelist = $langs->trans("ActionsOnOrder") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 257 | +	$titlelist = $langs->trans("ActionsOnOrder").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 258 | 258 |  	if (!empty($conf->dol_optimize_smallscreen)) { | 
| 259 | -		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 259 | +		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 260 | 260 | } | 
| 261 | 261 | |
| 262 | 262 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); | 
| @@ -27,11 +27,11 @@ discard block | ||
| 27 | 27 | |
| 28 | 28 | // Load Dolibarr environment | 
| 29 | 29 | require '../main.inc.php'; | 
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; | |
| 31 | -require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/expedition.lib.php'; | |
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; | |
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/sendings.lib.php'; | |
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; | |
| 31 | +require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; | |
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; | |
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; | |
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | /** | 
| @@ -123,11 +123,11 @@ discard block | ||
| 123 | 123 | */ | 
| 124 | 124 | |
| 125 | 125 | $form = new Form($db); | 
| 126 | -$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : ''; | |
| 127 | -$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Shipping uses ref primarily | |
| 126 | +$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; | |
| 127 | +$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Shipping uses ref primarily | |
| 128 | 128 | |
| 129 | 129 |  if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/shippingrefonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { // New constant or fallback | 
| 130 | -	$title = $object->ref . ' - ' . $langs->trans("Info"); | |
| 130 | +	$title = $object->ref.' - '.$langs->trans("Info"); | |
| 131 | 131 | } | 
| 132 | 132 | $help_url = "EN:Module_Shippings|FR:Module_Expeditions|ES:Módulo_Expediciones"; | 
| 133 | 133 |  llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-shipping page-card_messaging'); | 
| @@ -142,9 +142,9 @@ discard block | ||
| 142 | 142 |  if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['expedition'])) { | 
| 143 | 143 | $tmpurl = $_SESSION['pageforbacktolist']['expedition']; | 
| 144 | 144 |  	$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); | 
| 145 | -	$linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 145 | +	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 146 | 146 |  } else { | 
| 147 | -	$linkback = '<a href="' . DOL_URL_ROOT . '/expedition/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 147 | +	$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 148 | 148 | } | 
| 149 | 149 | |
| 150 | 150 | $morehtmlref = '<div class="refidno">'; | 
| @@ -152,7 +152,7 @@ discard block | ||
| 152 | 152 | $morehtmlref .= $object->ref; | 
| 153 | 153 | // Thirdparty | 
| 154 | 154 |  if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { | 
| 155 | - $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'shipping'); | |
| 155 | + $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'shipping'); | |
| 156 | 156 | } | 
| 157 | 157 | $morehtmlref .= '</div>'; | 
| 158 | 158 | |
| @@ -179,7 +179,7 @@ discard block | ||
| 179 | 179 | $out = ''; | 
| 180 | 180 |  $permok = $user->hasRight('agenda', 'myactions', 'create'); | 
| 181 | 181 |  if ($permok) { | 
| 182 | - $out .= '&shippingid=' . $object->id; | |
| 182 | + $out .= '&shippingid='.$object->id; | |
| 183 | 183 | } | 
| 184 | 184 | |
| 185 | 185 | |
| @@ -190,35 +190,35 @@ discard block | ||
| 190 | 190 | $morehtmlright = ''; | 
| 191 | 191 | |
| 192 | 192 | // Show link to change view in message | 
| 193 | - $messagingUrl = DOL_URL_ROOT . '/expedition/messaging.php?id=' . $object->id; | |
| 193 | + $messagingUrl = DOL_URL_ROOT.'/expedition/messaging.php?id='.$object->id; | |
| 194 | 194 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2); // Status 2 for "current page" | 
| 195 | 195 | |
| 196 | 196 | // Show link to change view in agenda | 
| 197 | - $messagingUrl = DOL_URL_ROOT . '/expedition/agenda.php?id=' . $object->id; | |
| 197 | + $messagingUrl = DOL_URL_ROOT.'/expedition/agenda.php?id='.$object->id; | |
| 198 | 198 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); // Status 1 for "not current page" | 
| 199 | 199 | |
| 200 | 200 | |
| 201 | 201 | // Show link to add event | 
| 202 | 202 |  	if (isModEnabled('agenda')) { | 
| 203 | 203 |  		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); | 
| 204 | -		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); | |
| 204 | +		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); | |
| 205 | 205 | } | 
| 206 | 206 | |
| 207 | - $param = '&id=' . $object->id; | |
| 207 | + $param = '&id='.$object->id; | |
| 208 | 208 |  	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { | 
| 209 | - $param .= '&contextpage=' . urlencode($contextpage); | |
| 209 | + $param .= '&contextpage='.urlencode($contextpage); | |
| 210 | 210 | } | 
| 211 | 211 |  	if ($limit > 0 && $limit != $conf->liste_limit) { | 
| 212 | - $param .= '&limit=' . ((int) $limit); | |
| 212 | + $param .= '&limit='.((int) $limit); | |
| 213 | 213 | } | 
| 214 | 214 | |
| 215 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; | |
| 216 | - $cachekey = 'count_events_expedition_' . $object->id; | |
| 215 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; | |
| 216 | + $cachekey = 'count_events_expedition_'.$object->id; | |
| 217 | 217 | $nbEvent = dol_getcache($cachekey); | 
| 218 | 218 | |
| 219 | -	$titlelist = $langs->trans("ActionsOnShipping") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 219 | +	$titlelist = $langs->trans("ActionsOnShipping").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 220 | 220 |  	if (!empty($conf->dol_optimize_smallscreen)) { | 
| 221 | -		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 221 | +		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 222 | 222 | } | 
| 223 | 223 | |
| 224 | 224 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); | 
| @@ -27,16 +27,16 @@ discard block | ||
| 27 | 27 | |
| 28 | 28 | // Load Dolibarr environment | 
| 29 | 29 | require '../main.inc.php'; | 
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; | |
| 31 | -require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; | |
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php'; | |
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/sendings.lib.php'; | |
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; | |
| 31 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; | |
| 32 | +require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; | |
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; | |
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; | |
| 35 | 35 | |
| 36 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; | |
| 37 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; | |
| 38 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/expedition.lib.php'; | |
| 39 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; | |
| 36 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; | |
| 37 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; | |
| 38 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; | |
| 39 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; | |
| 40 | 40 | |
| 41 | 41 | /** | 
| 42 | 42 | * @var Conf $conf | 
| @@ -125,11 +125,11 @@ discard block | ||
| 125 | 125 | */ | 
| 126 | 126 | |
| 127 | 127 | $form = new Form($db); | 
| 128 | -$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : ''; | |
| 129 | -$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Shipping uses ref primarily | |
| 128 | +$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; | |
| 129 | +$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Shipping uses ref primarily | |
| 130 | 130 | |
| 131 | 131 |  if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/shippingrefonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { // New constant or fallback | 
| 132 | -	$title = $object->ref . ' - ' . $langs->trans("Info"); | |
| 132 | +	$title = $object->ref.' - '.$langs->trans("Info"); | |
| 133 | 133 | } | 
| 134 | 134 | $help_url = "EN:Module_Shippings|FR:Module_Expeditions|ES:Módulo_Expediciones"; | 
| 135 | 135 |  llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-shipping page-card_agenda'); | 
| @@ -143,9 +143,9 @@ discard block | ||
| 143 | 143 |  if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['expedition'])) { | 
| 144 | 144 | $tmpurl = $_SESSION['pageforbacktolist']['expedition']; | 
| 145 | 145 |  	$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); | 
| 146 | -	$linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 146 | +	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 147 | 147 |  } else { | 
| 148 | -	$linkback = '<a href="' . DOL_URL_ROOT . '/expedition/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; // Changed from commande | |
| 148 | +	$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; // Changed from commande | |
| 149 | 149 | } | 
| 150 | 150 | |
| 151 | 151 | $morehtmlref = '<div class="refidno">'; | 
| @@ -153,7 +153,7 @@ discard block | ||
| 153 | 153 | $morehtmlref .= $object->ref; | 
| 154 | 154 | // Thirdparty | 
| 155 | 155 |  if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { | 
| 156 | - $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'shipping'); | |
| 156 | + $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'shipping'); | |
| 157 | 157 | } | 
| 158 | 158 | // Project - Keep as is if shipping can be linked to projects | 
| 159 | 159 |  if (isModEnabled('project')) { | 
| @@ -164,7 +164,7 @@ discard block | ||
| 164 | 164 | $proj->fetch($object->fk_project); | 
| 165 | 165 | $morehtmlref .= $proj->getNomUrl(1); | 
| 166 | 166 |  		if ($proj->title) { | 
| 167 | - $morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>'; | |
| 167 | + $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>'; | |
| 168 | 168 | } | 
| 169 | 169 | } | 
| 170 | 170 | } | 
| @@ -192,7 +192,7 @@ discard block | ||
| 192 | 192 | $out = ''; | 
| 193 | 193 |  $permok = $user->hasRight('agenda', 'myactions', 'create'); | 
| 194 | 194 |  if ($permok) { | 
| 195 | - $out .= '&shippingid=' . $object->id; | |
| 195 | + $out .= '&shippingid='.$object->id; | |
| 196 | 196 | } | 
| 197 | 197 | |
| 198 | 198 | |
| @@ -202,35 +202,35 @@ discard block | ||
| 202 | 202 | $morehtmlright = ''; | 
| 203 | 203 | |
| 204 | 204 | // Show link to change view in message | 
| 205 | - $messagingUrl = DOL_URL_ROOT . '/expedition/messaging.php?id=' . $object->id; | |
| 205 | + $messagingUrl = DOL_URL_ROOT.'/expedition/messaging.php?id='.$object->id; | |
| 206 | 206 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); | 
| 207 | 207 | |
| 208 | 208 | // Show link to change view in agenda | 
| 209 | - $messagingUrl = DOL_URL_ROOT . '/expedition/agenda.php?id=' . $object->id; | |
| 209 | + $messagingUrl = DOL_URL_ROOT.'/expedition/agenda.php?id='.$object->id; | |
| 210 | 210 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); | 
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | // Show link to add event | 
| 214 | 214 |  	if (isModEnabled('agenda')) { | 
| 215 | 215 |  		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); | 
| 216 | -		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); | |
| 216 | +		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); | |
| 217 | 217 | } | 
| 218 | 218 | |
| 219 | - $param = '&id=' . $object->id; | |
| 219 | + $param = '&id='.$object->id; | |
| 220 | 220 |  	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { | 
| 221 | - $param .= '&contextpage=' . urlencode($contextpage); | |
| 221 | + $param .= '&contextpage='.urlencode($contextpage); | |
| 222 | 222 | } | 
| 223 | 223 |  	if ($limit > 0 && $limit != $conf->liste_limit) { | 
| 224 | - $param .= '&limit=' . ((int) $limit); | |
| 224 | + $param .= '&limit='.((int) $limit); | |
| 225 | 225 | } | 
| 226 | 226 | |
| 227 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; | |
| 228 | - $cachekey = 'count_events_expedition_' . $object->id; | |
| 227 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; | |
| 228 | + $cachekey = 'count_events_expedition_'.$object->id; | |
| 229 | 229 | $nbEvent = dol_getcache($cachekey); | 
| 230 | 230 | |
| 231 | -	$titlelist = $langs->trans("ActionsOnShipping") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 231 | +	$titlelist = $langs->trans("ActionsOnShipping").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 232 | 232 |  	if (!empty($conf->dol_optimize_smallscreen)) { | 
| 233 | -		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 233 | +		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 234 | 234 | } | 
| 235 | 235 | |
| 236 | 236 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); | 
| @@ -21,7 +21,7 @@ discard block | ||
| 21 | 21 | |
| 22 | 22 | use Luracast\Restler\RestException; | 
| 23 | 23 | |
| 24 | -require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; | |
| 24 | +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; | |
| 25 | 25 | |
| 26 | 26 | /** | 
| 27 | 27 | * API class for accounts | 
| @@ -78,12 +78,12 @@ discard block | ||
| 78 | 78 | |
| 79 | 79 | $sql = "SELECT t.rowid FROM ".MAIN_DB_PREFIX."bank_account AS t LEFT JOIN ".MAIN_DB_PREFIX."bank_account_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields | 
| 80 | 80 |  		if ($category > 0) { | 
| 81 | - $sql .= ", " . MAIN_DB_PREFIX . "categorie_account as c"; | |
| 81 | + $sql .= ", ".MAIN_DB_PREFIX."categorie_account as c"; | |
| 82 | 82 | } | 
| 83 | -		$sql .= ' WHERE t.entity IN (' . getEntity('bank_account') . ')'; | |
| 83 | +		$sql .= ' WHERE t.entity IN ('.getEntity('bank_account').')'; | |
| 84 | 84 | // Select accounts of given category | 
| 85 | 85 |  		if ($category > 0) { | 
| 86 | - $sql .= " AND c.fk_categorie = " . ((int) $category) . " AND c.fk_account = t.rowid"; | |
| 86 | + $sql .= " AND c.fk_categorie = ".((int) $category)." AND c.fk_account = t.rowid"; | |
| 87 | 87 | } | 
| 88 | 88 | // Add sql filters | 
| 89 | 89 |  		if ($sqlfilters) { | 
| @@ -114,12 +114,12 @@ discard block | ||
| 114 | 114 | $obj = $this->db->fetch_object($result); | 
| 115 | 115 | $account = new Account($this->db); | 
| 116 | 116 |  				if ($account->fetch($obj->rowid) > 0) { | 
| 117 | - $account->balance = $account->solde(1); // 1=Exclude future operation date | |
| 117 | + $account->balance = $account->solde(1); // 1=Exclude future operation date | |
| 118 | 118 | $list[] = $this->_filterObjectProperties($this->_cleanObjectDatas($account), $properties); | 
| 119 | 119 | } | 
| 120 | 120 | } | 
| 121 | 121 |  		} else { | 
| 122 | - throw new RestException(503, 'Error when retrieving list of accounts: ' . $this->db->lasterror()); | |
| 122 | + throw new RestException(503, 'Error when retrieving list of accounts: '.$this->db->lasterror()); | |
| 123 | 123 | } | 
| 124 | 124 | |
| 125 | 125 | return $list; | 
| @@ -217,7 +217,7 @@ discard block | ||
| 217 | 217 | throw new RestException(403); | 
| 218 | 218 | } | 
| 219 | 219 | |
| 220 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; | |
| 220 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; | |
| 221 | 221 | |
| 222 | 222 | $accountfrom = new Account($this->db); | 
| 223 | 223 | $resultAccountFrom = $accountfrom->fetch($bankaccount_from_id); | 
| @@ -293,7 +293,7 @@ discard block | ||
| 293 | 293 | * Creating links between bank line record and its source | 
| 294 | 294 | */ | 
| 295 | 295 | |
| 296 | - $url = DOL_URL_ROOT . '/compta/bank/line.php?rowid='; | |
| 296 | + $url = DOL_URL_ROOT.'/compta/bank/line.php?rowid='; | |
| 297 | 297 | $label = '(banktransfert)'; | 
| 298 | 298 | $type = 'banktransfert'; | 
| 299 | 299 | |
| @@ -324,7 +324,7 @@ discard block | ||
| 324 | 324 | ); | 
| 325 | 325 |  		} else { | 
| 326 | 326 | $this->db->rollback(); | 
| 327 | - throw new RestException(500, $accountfrom->error . ' ' . $accountto->error); | |
| 327 | + throw new RestException(500, $accountfrom->error.' '.$accountto->error); | |
| 328 | 328 | } | 
| 329 | 329 | } | 
| 330 | 330 | |
| @@ -473,8 +473,8 @@ discard block | ||
| 473 | 473 | throw new RestException(404, 'account not found'); | 
| 474 | 474 | } | 
| 475 | 475 | |
| 476 | - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "bank "; | |
| 477 | - $sql .= " WHERE fk_account = " . ((int) $id); | |
| 476 | + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank "; | |
| 477 | + $sql .= " WHERE fk_account = ".((int) $id); | |
| 478 | 478 | |
| 479 | 479 | // Add sql filters | 
| 480 | 480 |  		if ($sqlfilters) { | 
| @@ -499,7 +499,7 @@ discard block | ||
| 499 | 499 | } | 
| 500 | 500 | } | 
| 501 | 501 |  		} else { | 
| 502 | - throw new RestException(503, 'Error when retrieving list of account lines: ' . $this->db->lasterror()); | |
| 502 | + throw new RestException(503, 'Error when retrieving list of account lines: '.$this->db->lasterror()); | |
| 503 | 503 | } | 
| 504 | 504 | |
| 505 | 505 | return $list; | 
| @@ -559,7 +559,7 @@ discard block | ||
| 559 | 559 | $num_releve | 
| 560 | 560 | ); | 
| 561 | 561 |  		if ($result < 0) { | 
| 562 | - throw new RestException(503, 'Error when adding line to account: ' . $account->error); | |
| 562 | + throw new RestException(503, 'Error when adding line to account: '.$account->error); | |
| 563 | 563 | } | 
| 564 | 564 | return $result; | 
| 565 | 565 | } | 
| @@ -601,7 +601,7 @@ discard block | ||
| 601 | 601 | |
| 602 | 602 | $result = $account->add_url_line($line_id, $url_id, $url, $label, $type); | 
| 603 | 603 |  		if ($result < 0) { | 
| 604 | - throw new RestException(503, 'Error when adding link to account line: ' . $account->error); | |
| 604 | + throw new RestException(503, 'Error when adding link to account line: '.$account->error); | |
| 605 | 605 | } | 
| 606 | 606 | return $result; | 
| 607 | 607 | } | 
| @@ -671,7 +671,7 @@ discard block | ||
| 671 | 671 | |
| 672 | 672 | $result = $accountLine->updateLabel(); | 
| 673 | 673 |  		if ($result < 0) { | 
| 674 | - throw new RestException(503, 'Error when updating link to account line: ' . $accountLine->error); | |
| 674 | + throw new RestException(503, 'Error when updating link to account line: '.$accountLine->error); | |
| 675 | 675 | } | 
| 676 | 676 | return $accountLine->id; | 
| 677 | 677 | } | 
| @@ -764,7 +764,7 @@ discard block | ||
| 764 | 764 | throw new RestException(404, 'account not found'); | 
| 765 | 765 | } | 
| 766 | 766 | |
| 767 | - $balance = $account->solde(1); //1=Exclude future operation date (this is to exclude input made in advance and have real account sold) | |
| 767 | + $balance = $account->solde(1); //1=Exclude future operation date (this is to exclude input made in advance and have real account sold) | |
| 768 | 768 | |
| 769 | 769 | return $balance; | 
| 770 | 770 | } | 
| @@ -71,7 +71,7 @@ discard block | ||
| 71 | 71 |  $search_doc_type = GETPOST("search_doc_type", 'alpha'); | 
| 72 | 72 |  $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); | 
| 73 | 73 | |
| 74 | -$search_doc_date = GETPOSTDATE('doc_date', 'getpost');	// deprecated. Can use 'search_date_start/end' | |
| 74 | +$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end' | |
| 75 | 75 | |
| 76 | 76 |  $search_date_start = GETPOSTDATE('search_date_start', 'getpost', 'auto', 'search_date_start_accountancy'); | 
| 77 | 77 |  $search_date_end = GETPOSTDATE('search_date_end', 'getpostend', 'auto', 'search_date_end_accountancy'); | 
| @@ -163,9 +163,9 @@ discard block | ||
| 163 | 163 | $sql = "SELECT date_start, date_end"; | 
| 164 | 164 | $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; | 
| 165 | 165 |  		if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) { | 
| 166 | -			$sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); | |
| 166 | +			$sql .= " WHERE rowid = ".getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); | |
| 167 | 167 |  		} else { | 
| 168 | - $sql .= " WHERE date_start < '" . $db->idate(dol_now()) . "' and date_end > '" . $db->idate(dol_now()) . "'"; | |
| 168 | + $sql .= " WHERE date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; | |
| 169 | 169 | } | 
| 170 | 170 | $sql .= $db->plimit(1); | 
| 171 | 171 | $res = $db->query($sql); | 
| @@ -287,7 +287,7 @@ discard block | ||
| 287 | 287 | $search_date_due_start = ''; | 
| 288 | 288 | // Due date end | 
| 289 | 289 | $search_date_due_end_day = ''; | 
| 290 | - $search_date_due_end_month = ''; | |
| 290 | + $search_date_due_end_month = ''; | |
| 291 | 291 | $search_date_due_end_year = ''; | 
| 292 | 292 | $search_date_due_end = ''; | 
| 293 | 293 | $search_debit = ''; | 
| @@ -463,7 +463,7 @@ discard block | ||
| 463 | 463 | // Actions | 
| 464 | 464 |  	if ($action === 'exporttopdf' && $permissiontoadd) { | 
| 465 | 465 |  		$object->fetchAll('ASC,ASC,ASC', 'code_journal,doc_date,piece_num', 0, 0, $filter); | 
| 466 | - require_once DOL_DOCUMENT_ROOT . '/core/modules/accountancy/doc/pdf_bookkeeping.modules.php'; | |
| 466 | + require_once DOL_DOCUMENT_ROOT.'/core/modules/accountancy/doc/pdf_bookkeeping.modules.php'; | |
| 467 | 467 | $pdf = new pdf_bookkeeping($db); | 
| 468 | 468 | $pdf->fromDate = $search_date_start; | 
| 469 | 469 | $pdf->toDate = $search_date_end; | 
| @@ -608,7 +608,7 @@ discard block | ||
| 608 | 608 | } | 
| 609 | 609 | |
| 610 | 610 |  			if (!$error) { | 
| 611 | -				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); | |
| 611 | +				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); | |
| 612 | 612 | exit(); | 
| 613 | 613 | } | 
| 614 | 614 |  		} elseif ($massaction == 'letteringmanual' && $permissiontoadd) { | 
| @@ -618,7 +618,7 @@ discard block | ||
| 618 | 618 |  				setEventMessages('', $lettering->errors, 'errors'); | 
| 619 | 619 |  			} else { | 
| 620 | 620 |  				setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); | 
| 621 | -				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); | |
| 621 | +				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); | |
| 622 | 622 | exit(); | 
| 623 | 623 | } | 
| 624 | 624 |  		} elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) { | 
| @@ -639,7 +639,7 @@ discard block | ||
| 639 | 639 | } | 
| 640 | 640 | |
| 641 | 641 |  			if (!$error) { | 
| 642 | -				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); | |
| 642 | +				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); | |
| 643 | 643 | exit(); | 
| 644 | 644 | } | 
| 645 | 645 |  		} elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) { | 
| @@ -649,7 +649,7 @@ discard block | ||
| 649 | 649 |  				setEventMessages('', $lettering->errors, 'errors'); | 
| 650 | 650 |  			} else { | 
| 651 | 651 |  				setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); | 
| 652 | -				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); | |
| 652 | +				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); | |
| 653 | 653 | exit(); | 
| 654 | 654 | } | 
| 655 | 655 | } | 
| @@ -830,10 +830,10 @@ discard block | ||
| 830 | 830 | // List of mass actions available | 
| 831 | 831 | $arrayofmassactions = array(); | 
| 832 | 832 |  if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { | 
| 833 | -	$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); | |
| 834 | -	$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); | |
| 835 | -	$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); | |
| 836 | -	$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); | |
| 833 | +	$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); | |
| 834 | +	$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); | |
| 835 | +	$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); | |
| 836 | +	$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); | |
| 837 | 837 | } | 
| 838 | 838 |  if ($user->hasRight('accounting', 'mouvements', 'creer')) { | 
| 839 | 839 |  	$arrayofmassactions['preclonebookkeepingwriting'] = img_picto('', 'clone', 'class="pictofixedwidth"').$langs->trans("Clone"); | 
| @@ -882,7 +882,7 @@ discard block | ||
| 882 | 882 |  	$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); | 
| 883 | 883 |  	$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly')); | 
| 884 | 884 |  	$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub'.$param, '', 1, array('morecss' => 'marginleftonly')); | 
| 885 | -	$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'] . '?action=exporttopdf&' . $param, '', 1, array('morecss' => 'marginleftonly')); | |
| 885 | +	$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'].'?action=exporttopdf&'.$param, '', 1, array('morecss' => 'marginleftonly')); | |
| 886 | 886 | |
| 887 | 887 | $url = './card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']); | 
| 888 | 888 |  	if (!empty($socid)) { | 
| @@ -902,16 +902,16 @@ discard block | ||
| 902 | 902 |  	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeleteBookkeepingWriting"), $langs->trans("ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)), "deletebookkeepingwriting", null, '', 0, 200, 500, 1); | 
| 903 | 903 |  } elseif ($massaction == 'preassignaccountbookkeepingwriting') { | 
| 904 | 904 |  	$input = $formaccounting->select_account('', 'account', 1); | 
| 905 | -	$formquestion = array(array('type' => 'other', 'name' => 'account', 'label' => '<span class="fieldrequired">' . $langs->trans("AccountAccountingShort") . '</span>', 'value' => $input),); | |
| 905 | +	$formquestion = array(array('type' => 'other', 'name' => 'account', 'label' => '<span class="fieldrequired">'.$langs->trans("AccountAccountingShort").'</span>', 'value' => $input),); | |
| 906 | 906 |  	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("confirmMassAssignAccountBookkeepingWritingConfirm"), $langs->trans("ConfirmMassAssignAccountBookkeepingWritingQuestion", count($toselect)), "assignaccountbookkeepingwriting", $formquestion, '', 0, 200, 500, 1); | 
| 907 | 907 |  } elseif ($massaction == 'preclonebookkeepingwriting') { | 
| 908 | 908 |  	$input1 = $form->selectDate('', 'massdate', 0, 0, 0, "create_mvt", 1, 1); | 
| 909 | - $input2 = $formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1) . '</td>'; | |
| 909 | + $input2 = $formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1).'</td>'; | |
| 910 | 910 | $formquestion = array( | 
| 911 | 911 | array( | 
| 912 | 912 | 'type' => 'other', | 
| 913 | 913 | 'name' => 'massdate', | 
| 914 | -			'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>', | |
| 914 | +			'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>', | |
| 915 | 915 | 'value' => $input1 | 
| 916 | 916 | ) | 
| 917 | 917 | ); | 
| @@ -920,7 +920,7 @@ discard block | ||
| 920 | 920 | $formquestion[] = array( | 
| 921 | 921 | 'type' => 'text', | 
| 922 | 922 | 'name' => 'code_journal', | 
| 923 | -			'label' => '<span class="fieldrequired">' . $langs->trans("Codejournal") . '</span>', | |
| 923 | +			'label' => '<span class="fieldrequired">'.$langs->trans("Codejournal").'</span>', | |
| 924 | 924 | 'value' => $input2 | 
| 925 | 925 | ); | 
| 926 | 926 | } | 
| @@ -935,7 +935,7 @@ discard block | ||
| 935 | 935 | ); | 
| 936 | 936 |  } elseif ($massaction == 'prereturnaccountbookkeepingwriting') { | 
| 937 | 937 |  	$input1 = $form->selectDate('', 'massdate', 0, 0, 0, "create_mvt", 1, 1); | 
| 938 | -	$formquestion = array(array('type' => 'other', 'name' => 'massdate', 'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>', 'value' => $input1)); | |
| 938 | +	$formquestion = array(array('type' => 'other', 'name' => 'massdate', 'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>', 'value' => $input1)); | |
| 939 | 939 |  	print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassReturnAccountBookkeepingWriting"), $langs->trans("ConfirmMassReturnAccountBookkeepingWritingQuestion", count($toselect)), "returnaccountbookkeepingwriting", $formquestion, '', 0, 200, 500, 1); | 
| 940 | 940 | } | 
| 941 | 941 | |
| @@ -1304,7 +1304,7 @@ discard block | ||
| 1304 | 1304 | } | 
| 1305 | 1305 | |
| 1306 | 1306 | // Document ref | 
| 1307 | - $modulepart = ''; // may be used by include*.tpl.php | |
| 1307 | + $modulepart = ''; // may be used by include*.tpl.php | |
| 1308 | 1308 |  	if (!empty($arrayfields['t.doc_ref']['checked'])) { | 
| 1309 | 1309 | $documentlink = ''; | 
| 1310 | 1310 | $objectstatic = null; | 
| @@ -1373,8 +1373,8 @@ discard block | ||
| 1373 | 1373 | $labeltoshow .= $objectstatic->getNomUrl(1); | 
| 1374 | 1374 | $labeltoshowalt .= $objectstatic->ref; | 
| 1375 | 1375 | $bank_ref = strstr($line->doc_ref, '-'); | 
| 1376 | - $labeltoshow .= " " . $bank_ref; | |
| 1377 | - $labeltoshowalt .= " " . $bank_ref; | |
| 1376 | + $labeltoshow .= " ".$bank_ref; | |
| 1377 | + $labeltoshowalt .= " ".$bank_ref; | |
| 1378 | 1378 |  		} else { | 
| 1379 | 1379 | $labeltoshow .= $line->doc_ref; | 
| 1380 | 1380 | $labeltoshowalt .= $line->doc_ref; | 
| @@ -27,11 +27,11 @@ discard block | ||
| 27 | 27 | |
| 28 | 28 | // Load Dolibarr environment | 
| 29 | 29 | require '../../main.inc.php'; | 
| 30 | -require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; | |
| 31 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php'; | |
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; | |
| 34 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; | |
| 30 | +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; | |
| 31 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; | |
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; | |
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; | |
| 34 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; | |
| 35 | 35 | |
| 36 | 36 | /** | 
| 37 | 37 | * @var Conf $conf | 
| @@ -125,10 +125,10 @@ discard block | ||
| 125 | 125 | |
| 126 | 126 | $form = new Form($db); | 
| 127 | 127 | |
| 128 | -$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : ''; | |
| 129 | -$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Removed $object->name as orders typically don't have it | |
| 128 | +$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; | |
| 129 | +$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Removed $object->name as orders typically don't have it | |
| 130 | 130 |  if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/ordernamonly/', getDolGlobalString('MAIN_HTML_TITLE'))) { // Changed from projectnameonly | 
| 131 | -	$title = $object->ref . ' - ' . $langs->trans("Info"); // Simplified title | |
| 131 | +	$title = $object->ref.' - '.$langs->trans("Info"); // Simplified title | |
| 132 | 132 | } | 
| 133 | 133 | $help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos|DE:Modul_Angebote'; | 
| 134 | 134 | |
| @@ -140,14 +140,14 @@ discard block | ||
| 140 | 140 | |
| 141 | 141 | // Object card | 
| 142 | 142 | // ------------------------------------------------------------ | 
| 143 | -$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; | |
| 143 | +$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; | |
| 144 | 144 | |
| 145 | 145 | $morehtmlref = '<div class="refidno">'; | 
| 146 | 146 | // Ref customer | 
| 147 | 147 |  $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', 0, 1); | 
| 148 | 148 |  $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); | 
| 149 | 149 | // Thirdparty | 
| 150 | -$morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1); | |
| 150 | +$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1); | |
| 151 | 151 | // Project | 
| 152 | 152 |  if (isModEnabled('project')) { | 
| 153 | 153 |  	$langs->load("projects"); | 
| @@ -155,16 +155,16 @@ discard block | ||
| 155 | 155 |  	if (0) {	// @phpstan-ignore-line | 
| 156 | 156 |  		$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); | 
| 157 | 157 |  		if ($action != 'classify') { | 
| 158 | -			$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; | |
| 158 | +			$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> '; | |
| 159 | 159 | } | 
| 160 | - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); | |
| 160 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); | |
| 161 | 161 |  	} else { | 
| 162 | 162 |  		if (!empty($object->fk_project)) { | 
| 163 | 163 | $proj = new Project($db); | 
| 164 | 164 | $proj->fetch($object->fk_project); | 
| 165 | 165 | $morehtmlref .= $proj->getNomUrl(1); | 
| 166 | 166 |  			if ($proj->title) { | 
| 167 | - $morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>'; | |
| 167 | + $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>'; | |
| 168 | 168 | } | 
| 169 | 169 | } | 
| 170 | 170 | } | 
| @@ -191,7 +191,7 @@ discard block | ||
| 191 | 191 | $out = ''; | 
| 192 | 192 |  $permok = $user->hasRight('agenda', 'myactions', 'create'); | 
| 193 | 193 |  if ($permok) { | 
| 194 | - $out .= '&propalid=' . $object->id; | |
| 194 | + $out .= '&propalid='.$object->id; | |
| 195 | 195 | } | 
| 196 | 196 | |
| 197 | 197 | |
| @@ -206,11 +206,11 @@ discard block | ||
| 206 | 206 | |
| 207 | 207 | |
| 208 | 208 | // Show link to change view in message | 
| 209 | - $messagingUrl = DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id; // Changed from projet | |
| 209 | + $messagingUrl = DOL_URL_ROOT.'/comm/propal/messaging.php?id='.$object->id; // Changed from projet | |
| 210 | 210 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2); | 
| 211 | 211 | |
| 212 | 212 | // Show link to change view in agenda | 
| 213 | - $messagingUrl = DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id; // Changed from projet | |
| 213 | + $messagingUrl = DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id; // Changed from projet | |
| 214 | 214 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); | 
| 215 | 215 | |
| 216 | 216 | |
| @@ -227,24 +227,24 @@ discard block | ||
| 227 | 227 | // Show link to add event | 
| 228 | 228 |  	if (isModEnabled('agenda')) { | 
| 229 | 229 |  		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); | 
| 230 | -		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); | |
| 230 | +		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); | |
| 231 | 231 | } | 
| 232 | 232 | |
| 233 | - $param = '&id=' . $object->id; | |
| 233 | + $param = '&id='.$object->id; | |
| 234 | 234 |  	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { | 
| 235 | - $param .= '&contextpage=' . urlencode($contextpage); | |
| 235 | + $param .= '&contextpage='.urlencode($contextpage); | |
| 236 | 236 | } | 
| 237 | 237 |  	if ($limit > 0 && $limit != $conf->liste_limit) { | 
| 238 | - $param .= '&limit=' . ((int) $limit); | |
| 238 | + $param .= '&limit='.((int) $limit); | |
| 239 | 239 | } | 
| 240 | 240 | |
| 241 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; | |
| 242 | - $cachekey = 'count_events_propal_' . $object->id; | |
| 241 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; | |
| 242 | + $cachekey = 'count_events_propal_'.$object->id; | |
| 243 | 243 | $nbEvent = dol_getcache($cachekey); | 
| 244 | 244 | |
| 245 | -	$titlelist = $langs->trans("ActionsOnPropal") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); // Changed from ActionsOnProject | |
| 245 | +	$titlelist = $langs->trans("ActionsOnPropal").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); // Changed from ActionsOnProject | |
| 246 | 246 |  	if (!empty($conf->dol_optimize_smallscreen)) { | 
| 247 | -		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 247 | +		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 248 | 248 | } | 
| 249 | 249 | |
| 250 | 250 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); | 
| @@ -29,12 +29,12 @@ discard block | ||
| 29 | 29 | |
| 30 | 30 | // Load Dolibarr environment | 
| 31 | 31 | require '../../main.inc.php'; | 
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; | |
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/fourn.lib.php'; | |
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; | |
| 35 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; | |
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; | |
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; | |
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; | |
| 35 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; | |
| 36 | 36 |  if (isModEnabled('project')) { | 
| 37 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; | |
| 37 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; | |
| 38 | 38 | } | 
| 39 | 39 | |
| 40 | 40 | /** | 
| @@ -95,8 +95,8 @@ discard block | ||
| 95 | 95 | accessforbidden(); | 
| 96 | 96 | } | 
| 97 | 97 | |
| 98 | -$usercancreate	= ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); | |
| 99 | -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php | |
| 98 | +$usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); | |
| 99 | +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php | |
| 100 | 100 | $caneditproject = false; | 
| 101 | 101 | |
| 102 | 102 | |
| @@ -131,9 +131,9 @@ discard block | ||
| 131 | 131 | $object->info($object->id); | 
| 132 | 132 | } | 
| 133 | 133 | |
| 134 | -$title = $object->ref . ' - ' . $langs->trans('Info') . ' - ' . $object->ref . ' ' . $object->name; | |
| 134 | +$title = $object->ref.' - '.$langs->trans('Info').' - '.$object->ref.' '.$object->name; | |
| 135 | 135 |  if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/projectnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) { | 
| 136 | -	$title = $object->ref . ' ' . $object->name . ' - ' . $langs->trans("Info"); | |
| 136 | +	$title = $object->ref.' '.$object->name.' - '.$langs->trans("Info"); | |
| 137 | 137 | } | 
| 138 | 138 | $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; | 
| 139 | 139 |  llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-supplier-order page-info'); | 
| @@ -146,14 +146,14 @@ discard block | ||
| 146 | 146 | |
| 147 | 147 | // Supplier order card | 
| 148 | 148 | |
| 149 | -$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/commande/list.php' . (!empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; | |
| 149 | +$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; | |
| 150 | 150 | |
| 151 | 151 | $morehtmlref = '<div class="refidno">'; | 
| 152 | 152 | // Ref supplier | 
| 153 | 153 |  $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); | 
| 154 | 154 |  $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); | 
| 155 | 155 | // Thirdparty | 
| 156 | -$morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1); | |
| 156 | +$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1); | |
| 157 | 157 | // Project | 
| 158 | 158 |  if (isModEnabled('project')) { | 
| 159 | 159 |  	$langs->load("projects"); | 
| @@ -161,16 +161,16 @@ discard block | ||
| 161 | 161 |  	if (0) {	// @phpstan-ignore-line | 
| 162 | 162 |  		$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); | 
| 163 | 163 |  		if ($action != 'classify' && $caneditproject) {  // Always false @phpstan-ignore-line | 
| 164 | -			$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; | |
| 164 | +			$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> '; | |
| 165 | 165 | } | 
| 166 | -		$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); | |
| 166 | +		$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); | |
| 167 | 167 |  	} else { | 
| 168 | 168 |  		if (!empty($object->fk_project)) { | 
| 169 | 169 | $proj = new Project($db); | 
| 170 | 170 | $proj->fetch($object->fk_project); | 
| 171 | 171 | $morehtmlref .= $proj->getNomUrl(1); | 
| 172 | 172 |  			if ($proj->title) { | 
| 173 | - $morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>'; | |
| 173 | + $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>'; | |
| 174 | 174 | } | 
| 175 | 175 | } | 
| 176 | 176 | } | 
| @@ -195,7 +195,7 @@ discard block | ||
| 195 | 195 | $out = ''; | 
| 196 | 196 |  $permok = $user->hasRight('agenda', 'myactions', 'create'); | 
| 197 | 197 |  if ($permok) { | 
| 198 | - $out .= '&originid=' . $object->id . '&origin=order_supplier'; | |
| 198 | + $out .= '&originid='.$object->id.'&origin=order_supplier'; | |
| 199 | 199 | } | 
| 200 | 200 | |
| 201 | 201 | // print '<div class="tabsAction">'; | 
| @@ -215,25 +215,25 @@ discard block | ||
| 215 | 215 | $morehtmlright = ''; | 
| 216 | 216 | |
| 217 | 217 | // Show link to change view in message | 
| 218 | - $messagingUrl = DOL_URL_ROOT . '/fourn/commande/messaging.php?id=' . $object->id; | |
| 218 | + $messagingUrl = DOL_URL_ROOT.'/fourn/commande/messaging.php?id='.$object->id; | |
| 219 | 219 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); // Status 1 for "not current page" | 
| 220 | 220 | |
| 221 | 221 | // Show link to change view in agenda | 
| 222 | - $messagingUrl = DOL_URL_ROOT . '/fourn/commande/info.php?id=' . $object->id; | |
| 222 | + $messagingUrl = DOL_URL_ROOT.'/fourn/commande/info.php?id='.$object->id; | |
| 223 | 223 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); // Status 2 for "current page" | 
| 224 | 224 | |
| 225 | 225 | // Show link to add event | 
| 226 | 226 |  	if (isModEnabled('agenda')) { | 
| 227 | 227 |  		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); | 
| 228 | -		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); | |
| 228 | +		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); | |
| 229 | 229 | } | 
| 230 | 230 | |
| 231 | - $param = '&id=' . $object->id; | |
| 231 | + $param = '&id='.$object->id; | |
| 232 | 232 |  	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { | 
| 233 | - $param .= '&contextpage=' . $contextpage; | |
| 233 | + $param .= '&contextpage='.$contextpage; | |
| 234 | 234 | } | 
| 235 | 235 |  	if ($limit > 0 && $limit != $conf->liste_limit) { | 
| 236 | - $param .= '&limit=' . $limit; | |
| 236 | + $param .= '&limit='.$limit; | |
| 237 | 237 | } | 
| 238 | 238 | |
| 239 | 239 |  	// print load_fiche_titre($langs->trans("ActionsOnOrder"), '', ''); | 
| @@ -249,14 +249,14 @@ discard block | ||
| 249 | 249 | // List of done actions | 
| 250 | 250 | //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); | 
| 251 | 251 | |
| 252 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; | |
| 253 | - $cachekey = 'count_events_commande_' . $object->id; | |
| 252 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; | |
| 253 | + $cachekey = 'count_events_commande_'.$object->id; | |
| 254 | 254 | $nbEvent = dol_getcache($cachekey); | 
| 255 | 255 | |
| 256 | 256 | |
| 257 | -	$titlelist = $langs->trans("ActionsOnOrder") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 257 | +	$titlelist = $langs->trans("ActionsOnOrder").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 258 | 258 |  	if (!empty($conf->dol_optimize_smallscreen)) { | 
| 259 | -		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 259 | +		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 260 | 260 | } | 
| 261 | 261 | |
| 262 | 262 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); | 
| @@ -27,12 +27,12 @@ discard block | ||
| 27 | 27 | |
| 28 | 28 | // Load Dolibarr environment | 
| 29 | 29 | require '../../main.inc.php'; | 
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; | |
| 31 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/fourn.lib.php'; | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; | |
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; | |
| 34 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; | |
| 35 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; | |
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; | |
| 31 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; | |
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; | |
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; | |
| 34 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; | |
| 35 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; | |
| 36 | 36 | |
| 37 | 37 | /** | 
| 38 | 38 | * @var Conf $conf | 
| @@ -85,14 +85,14 @@ discard block | ||
| 85 | 85 |  $hookmanager->initHooks(array('orderagenda', 'globalcard')); | 
| 86 | 86 | |
| 87 | 87 | // Load object | 
| 88 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals | |
| 88 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals | |
| 89 | 89 |  if ($id > 0 || !empty($ref)) { | 
| 90 | - $upload_dir = $conf->order->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity] . "/" . $object->id; | |
| 90 | + $upload_dir = $conf->order->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; | |
| 91 | 91 | } | 
| 92 | 92 | |
| 93 | 93 | // Security check | 
| 94 | 94 |  if ($user->socid > 0) { | 
| 95 | - $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of order and assignment. | |
| 95 | + $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of order and assignment. | |
| 96 | 96 | } | 
| 97 | 97 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); | 
| 98 | 98 | restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande', 'fk_soc', 'rowid', $isdraft); | 
| @@ -139,10 +139,10 @@ discard block | ||
| 139 | 139 | |
| 140 | 140 | $form = new Form($db); | 
| 141 | 141 | |
| 142 | -$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : ''; | |
| 143 | -$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Removed $object->name as orders typically don't have it | |
| 142 | +$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; | |
| 143 | +$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Removed $object->name as orders typically don't have it | |
| 144 | 144 |  if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/ordernamonly/', getDolGlobalString('MAIN_HTML_TITLE'))) { | 
| 145 | -	$title = $object->ref . ' - ' . $langs->trans("Info"); // Simplified title | |
| 145 | +	$title = $object->ref.' - '.$langs->trans("Info"); // Simplified title | |
| 146 | 146 | } | 
| 147 | 147 | $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; | 
| 148 | 148 |  llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_messaging'); | 
| @@ -154,9 +154,9 @@ discard block | ||
| 154 | 154 |  if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['order'])) { | 
| 155 | 155 | $tmpurl = $_SESSION['pageforbacktolist']['order']; | 
| 156 | 156 |  	$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); | 
| 157 | -	$linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 157 | +	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 158 | 158 |  } else { | 
| 159 | -	$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/commande/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; | |
| 159 | +	$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; | |
| 160 | 160 | } | 
| 161 | 161 | |
| 162 | 162 | $morehtmlref = '<div class="refidno">'; | 
| @@ -164,7 +164,7 @@ discard block | ||
| 164 | 164 | $morehtmlref .= $object->ref; | 
| 165 | 165 | // Thirdparty | 
| 166 | 166 |  if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { | 
| 167 | - $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'order'); | |
| 167 | + $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'order'); | |
| 168 | 168 | } | 
| 169 | 169 | $morehtmlref .= '</div>'; | 
| 170 | 170 | |
| @@ -197,7 +197,7 @@ discard block | ||
| 197 | 197 | $out = ''; | 
| 198 | 198 |  $permok = $user->hasRight('agenda', 'myactions', 'create'); | 
| 199 | 199 |  if ($permok) { | 
| 200 | - $out .= '&orderid=' . $object->id; | |
| 200 | + $out .= '&orderid='.$object->id; | |
| 201 | 201 | } | 
| 202 | 202 | |
| 203 | 203 | |
| @@ -212,11 +212,11 @@ discard block | ||
| 212 | 212 | |
| 213 | 213 | |
| 214 | 214 | // Show link to change view in message | 
| 215 | - $messagingUrl = DOL_URL_ROOT . '/fourn/commande/messaging.php?id=' . $object->id; | |
| 215 | + $messagingUrl = DOL_URL_ROOT.'/fourn/commande/messaging.php?id='.$object->id; | |
| 216 | 216 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2); | 
| 217 | 217 | |
| 218 | 218 | // Show link to change view in agenda | 
| 219 | - $messagingUrl = DOL_URL_ROOT . '/fourn/commande/info.php?id=' . $object->id; | |
| 219 | + $messagingUrl = DOL_URL_ROOT.'/fourn/commande/info.php?id='.$object->id; | |
| 220 | 220 |  	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); | 
| 221 | 221 | |
| 222 | 222 | |
| @@ -233,24 +233,24 @@ discard block | ||
| 233 | 233 | // Show link to add event | 
| 234 | 234 |  	if (isModEnabled('agenda')) { | 
| 235 | 235 |  		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); | 
| 236 | -		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); | |
| 236 | +		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); | |
| 237 | 237 | } | 
| 238 | 238 | |
| 239 | - $param = '&id=' . $object->id; | |
| 239 | + $param = '&id='.$object->id; | |
| 240 | 240 |  	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { | 
| 241 | - $param .= '&contextpage=' . urlencode($contextpage); | |
| 241 | + $param .= '&contextpage='.urlencode($contextpage); | |
| 242 | 242 | } | 
| 243 | 243 |  	if ($limit > 0 && $limit != $conf->liste_limit) { | 
| 244 | - $param .= '&limit=' . ((int) $limit); | |
| 244 | + $param .= '&limit='.((int) $limit); | |
| 245 | 245 | } | 
| 246 | 246 | |
| 247 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; | |
| 248 | - $cachekey = 'count_events_order_' . $object->id; | |
| 247 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; | |
| 248 | + $cachekey = 'count_events_order_'.$object->id; | |
| 249 | 249 | $nbEvent = dol_getcache($cachekey); | 
| 250 | 250 | |
| 251 | -	$titlelist = $langs->trans("ActionsOnOrder") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 251 | +	$titlelist = $langs->trans("ActionsOnOrder").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 252 | 252 |  	if (!empty($conf->dol_optimize_smallscreen)) { | 
| 253 | -		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); | |
| 253 | +		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); | |
| 254 | 254 | } | 
| 255 | 255 | |
| 256 | 256 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); |