浏览代码

Fixing style errors.

stickler-ci 3 年之前
父节点
当前提交
f0677ed665
共有 2 个文件被更改,包括 64 次插入65 次删除
  1. 48 49
      htdocs/contact/project.php
  2. 16 16
      htdocs/core/lib/contact.lib.php

+ 48 - 49
htdocs/contact/project.php

@@ -40,8 +40,8 @@ $hookmanager->initHooks(array('projectcontact'));
 
 $parameters = array('id' => $id);
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
-if($reshook < 0) {
-    setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+if ($reshook < 0) {
+	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
 }
 
 /*
@@ -50,67 +50,66 @@ if($reshook < 0) {
 
 $form = new Form($db);
 
-if($id) {
-    require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
-    require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
+if ($id) {
+	require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
 
-    $object = new Contact($db);
+	$object = new Contact($db);
 
-    $result = $object->fetch($id);
-    if(empty($object->thirdparty)) {
-        $object->fetch_thirdparty();
-    }
-    $socid = $object->thirdparty->id;
-    $title = $langs->trans("Projects");
-    if(! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
-        $title = $object->name." - ".$title;
-    }
-    llxHeader('', $title);
+	$result = $object->fetch($id);
+	if (empty($object->thirdparty)) {
+		$object->fetch_thirdparty();
+	}
+	$socid = $object->thirdparty->id;
+	$title = $langs->trans("Projects");
+	if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
+		$title = $object->name." - ".$title;
+	}
+	llxHeader('', $title);
 
-    if(! empty($conf->notification->enabled)) {
-        $langs->load("mails");
-    }
-    $head = contact_prepare_head($object);
+	if (! empty($conf->notification->enabled)) {
+		$langs->load("mails");
+	}
+	$head = contact_prepare_head($object);
 
-    print dol_get_fiche_head($head, 'project', $langs->trans("Contact"), -1, 'contact');
+	print dol_get_fiche_head($head, 'project', $langs->trans("Contact"), -1, 'contact');
 
-    $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
+	$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
 
-    $morehtmlref = '<div class="refidno">';
-    if(empty($conf->global->SOCIETE_DISABLE_CONTACTS) && !empty($socid)) {
-        $object->thirdparty->fetch($socid);
-        // Thirdparty
-        $morehtmlref .= $langs->trans('ThirdParty').' : ';
-        if($object->thirdparty->id > 0) {
-            $morehtmlref .= $object->thirdparty->getNomUrl(1, 'contact');
-        }
-        else {
-            $morehtmlref .= $langs->trans("ContactNotLinkedToCompany");
-        }
-    }
-    $morehtmlref .= '</div>';
+	$morehtmlref = '<div class="refidno">';
+	if (empty($conf->global->SOCIETE_DISABLE_CONTACTS) && !empty($socid)) {
+		$object->thirdparty->fetch($socid);
+		// Thirdparty
+		$morehtmlref .= $langs->trans('ThirdParty').' : ';
+		if ($object->thirdparty->id > 0) {
+			$morehtmlref .= $object->thirdparty->getNomUrl(1, 'contact');
+		} else {
+			$morehtmlref .= $langs->trans("ContactNotLinkedToCompany");
+		}
+	}
+	$morehtmlref .= '</div>';
 
-    dol_banner_tab($object, 'id', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', $morehtmlref);
+	dol_banner_tab($object, 'id', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', $morehtmlref);
 
-    print '<div class="fichecenter">';
+	print '<div class="fichecenter">';
 
-    print '<div class="underbanner clearboth"></div>';
-    print '<table class="border centpercent tableforfield">';
+	print '<div class="underbanner clearboth"></div>';
+	print '<table class="border centpercent tableforfield">';
 
-// Civility
-    print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td>';
-    print $object->getCivilityLabel();
-    print '</td></tr>';
+	// Civility
+	print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td>';
+	print $object->getCivilityLabel();
+	print '</td></tr>';
 
-    print '</table>';
+	print '</table>';
 
-    print '</div>';
+	print '</div>';
 
-    print dol_get_fiche_end();
-    print '<br>';
+	print dol_get_fiche_end();
+	print '<br>';
 
-    // Projects list
-    $result = show_contacts_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?id='.$object->id, 1);
+	// Projects list
+	$result = show_contacts_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?id='.$object->id, 1);
 }
 
 // End of page

+ 16 - 16
htdocs/core/lib/contact.lib.php

@@ -57,7 +57,7 @@ function contact_prepare_head(Contact $object)
 	$head[$tab][2] = 'perso';
 	$tab++;
 
-    if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) {
+	if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) {
 		$nbProject = 0;
 		// Enable caching of thirdrparty count projects
 		require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@@ -67,12 +67,12 @@ function contact_prepare_head(Contact $object)
 		if (!is_null($dataretrieved)) {
 			$nbProject = $dataretrieved;
 		} else {
-            $sql = 'SELECT COUNT(n.rowid) as nb';
-            $sql .= ' FROM '.MAIN_DB_PREFIX.'projet as n';
-            $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (n.rowid = cc.element_id)';
-            $sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id);
-            $sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element="project" AND source="external")';
-            $sql .= ' AND n.entity IN ('.getEntity('project').')';
+			$sql = 'SELECT COUNT(n.rowid) as nb';
+			$sql .= ' FROM '.MAIN_DB_PREFIX.'projet as n';
+			$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (n.rowid = cc.element_id)';
+			$sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id);
+			$sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element="project" AND source="external")';
+			$sql .= ' AND n.entity IN ('.getEntity('project').')';
 			$resql = $db->query($sql);
 			if ($resql) {
 				$obj = $db->fetch_object($resql);
@@ -184,14 +184,14 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $
 		print "\n".'<table class="noborder" width=100%>';
 
 		$sql  = 'SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount';
-        $sql .= ', cls.code as opp_status_code';
-        $sql .= ' FROM '.MAIN_DB_PREFIX.'projet as p';
-        $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_lead_status as cls on p.fk_opp_status = cls.rowid';
-        $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (p.rowid = cc.element_id)';
-        $sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id);
-        $sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element="project" AND source="external")';
-        $sql .= ' AND p.entity IN ('.getEntity('project').')';
-        $sql .= ' ORDER BY p.dateo DESC';
+		$sql .= ', cls.code as opp_status_code';
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'projet as p';
+		$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_lead_status as cls on p.fk_opp_status = cls.rowid';
+		$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (p.rowid = cc.element_id)';
+		$sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id);
+		$sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element="project" AND source="external")';
+		$sql .= ' AND p.entity IN ('.getEntity('project').')';
+		$sql .= ' ORDER BY p.dateo DESC';
 
 		$result = $db->query($sql);
 		if ($result) {
@@ -275,4 +275,4 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $
 	}
 
 	return $i;
-}
+}