diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 6a676bf24e9..395a3893b7d 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -374,13 +374,12 @@ class Partnership extends CommonObject if ($ref) { $sql .= " AND p.ref='".$this->db->escape($ref)."'"; } - - if($fk_soc_or_member){ + + if ($fk_soc_or_member) { $sql .= ' AND'; - if($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') + if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') $sql .= ' p.fk_member = '; - else - $sql .= ' p.fk_soc = '; + else $sql .= ' p.fk_soc = '; $sql .= $fk_soc_or_member; $sql .= ' ORDER BY p.date_partnership_end DESC'; } diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index 2484936f686..2576c2348c5 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -144,12 +144,12 @@ if (empty($permissiontoread)) accessforbidden(); if ($action == 'edit' && empty($permissiontoadd)) accessforbidden(); $partnershipid = $object->fetch(0, "", $socid); -if(empty($action) && empty($partnershipid)){ +if (empty($action) && empty($partnershipid)) { $action = 'create'; } if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT && !empty($user->socid)) accessforbidden(); -if(empty($socid) && $object){ +if (empty($socid) && $object) { $socid = $object->fk_soc; } /* @@ -262,7 +262,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); exit; } - + // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; @@ -352,7 +352,6 @@ if ($socid) { $newcardbutton .= dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$societe->id.'&backtopage='.urlencode($backtopage), '', 1, $params); print '
'; - } else { dol_print_error('', 'Parameter socid not defined'); } @@ -442,8 +441,6 @@ if (($partnershipid || $ref) && $action == 'edit') { // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - - print load_fiche_titre($langs->trans("PartnershipDedicatedToThisThirdParty", $langs->transnoentitiesnoconv("Partnership")), '', ''); $res = $object->fetch_optionals(); @@ -536,7 +533,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (empty($reshook)) { - if ($object->status == $object::STATUS_DRAFT) { print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$socid.'&action=edit', '', $permissiontoadd); }