Fix phpcs
This commit is contained in:
parent
5b0dd0e31b
commit
5edaa9a98c
@ -19,16 +19,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/multicompany/actions_multicompany.class.php
|
* \file htdocs/stripe/class/actions_stripe.class.php
|
||||||
* \ingroup multicompany
|
* \ingroup stripe
|
||||||
* \brief File Class multicompany
|
* \brief File Class actionsstripeconnect
|
||||||
*/
|
*/
|
||||||
require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';;
|
require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';;
|
||||||
|
|
||||||
|
|
||||||
$langs->load("stripe@stripe");
|
$langs->load("stripe@stripe");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class ActionsMulticompany
|
* Class Actions Stripe Connect
|
||||||
* \brief Class Actions of the module multicompany
|
|
||||||
*/
|
*/
|
||||||
class ActionsStripeconnect
|
class ActionsStripeconnect
|
||||||
{
|
{
|
||||||
@ -54,21 +56,25 @@ class ActionsStripeconnect
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* formObjectOptions
|
||||||
*
|
*
|
||||||
|
* @param array $parameters Parameters
|
||||||
|
* @param Object $object Object
|
||||||
|
* @param string $action Action
|
||||||
*/
|
*/
|
||||||
function formObjectOptions($parameters=false, &$object, &$action='')
|
function formObjectOptions($parameters=false, &$object, &$action='')
|
||||||
{
|
{
|
||||||
global $db,$conf,$user,$langs,$form;
|
global $db,$conf,$user,$langs,$form;
|
||||||
|
|
||||||
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || empty($conf->global->STRIPECONNECT_LIVE) || GETPOST('forcesandbox','alpha')))
|
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || empty($conf->global->STRIPECONNECT_LIVE) || GETPOST('forcesandbox','alpha')))
|
||||||
{
|
{
|
||||||
$service = 'StripeTest';
|
$service = 'StripeTest';
|
||||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
|
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$service = 'StripeLive';
|
$service = 'StripeLive';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($parameters) && ! empty($parameters))
|
if (is_array($parameters) && ! empty($parameters))
|
||||||
{
|
{
|
||||||
@ -85,18 +91,18 @@ else
|
|||||||
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
|
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||||
$this->resprints.= $langs->trans('StripeCustomer');
|
$this->resprints.= $langs->trans('StripeCustomer');
|
||||||
$this->resprints.= '<td><td align="right">';
|
$this->resprints.= '<td><td align="right">';
|
||||||
// $this->resprints.= '<a href="'.$dolibarr_main_url_root.dol_buildpath('/dolipress/card.php?socid='.$object->id, 1).'">'.img_edit().'</a>';
|
// $this->resprints.= '<a href="'.$dolibarr_main_url_root.dol_buildpath('/dolipress/card.php?socid='.$object->id, 1).'">'.img_edit().'</a>';
|
||||||
$this->resprints.= '</td></tr></table>';
|
$this->resprints.= '</td></tr></table>';
|
||||||
$this->resprints.= '</td>';
|
$this->resprints.= '</td>';
|
||||||
$this->resprints.= '<td colspan="3">';
|
$this->resprints.= '<td colspan="3">';
|
||||||
$stripe=new Stripe($db);
|
$stripe=new Stripe($db);
|
||||||
if ($stripe->getStripeAccount($service)&&$object->client!=0) {
|
if ($stripe->getStripeAccount($service)&&$object->client!=0) {
|
||||||
$customer=$stripe->customerStripe($object->id,$stripe->getStripeAccount($service));
|
$customer=$stripe->customerStripe($object->id,$stripe->getStripeAccount($service));
|
||||||
$this->resprints.= $customer->id;
|
$this->resprints.= $customer->id;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -109,13 +115,13 @@ $this->resprints.= $langs->trans("NoStripe");
|
|||||||
$this->resprints.= '</td>';
|
$this->resprints.= '</td>';
|
||||||
$this->resprints.= '<td colspan="3">';
|
$this->resprints.= '<td colspan="3">';
|
||||||
$stripe=new Stripe($db);
|
$stripe=new Stripe($db);
|
||||||
if ($stripe->getStripeAccount($service)&&$object->fk_soc>'0') {
|
if ($stripe->getStripeAccount($service)&&$object->fk_soc>'0') {
|
||||||
$customer=$stripe->customerStripe($object->fk_soc,$stripe->getStripeAccount($service));
|
$customer=$stripe->customerStripe($object->fk_soc,$stripe->getStripeAccount($service));
|
||||||
$this->resprints.= $customer->id;
|
$this->resprints.= $customer->id;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
|
|
||||||
$this->resprints.= '<tr><td>';
|
$this->resprints.= '<tr><td>';
|
||||||
@ -126,13 +132,13 @@ $this->resprints.= $langs->trans("NoStripe");
|
|||||||
$this->resprints.= '</td>';
|
$this->resprints.= '</td>';
|
||||||
$this->resprints.= '<td colspan="3">';
|
$this->resprints.= '<td colspan="3">';
|
||||||
$stripe=new Stripe($db);
|
$stripe=new Stripe($db);
|
||||||
if (7==4) {
|
if (7==4) {
|
||||||
$customer=$stripe->customerStripe($object->id,$stripe->getStripeAccount($service));
|
$customer=$stripe->customerStripe($object->id,$stripe->getStripeAccount($service));
|
||||||
$this->resprints.= $customer->id;
|
$this->resprints.= $customer->id;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
}
|
}
|
||||||
elseif (is_object($object) && $object->element == 'adherent_type'){
|
elseif (is_object($object) && $object->element == 'adherent_type'){
|
||||||
@ -140,23 +146,31 @@ $this->resprints.= $langs->trans("NoStripe");
|
|||||||
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
|
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||||
$this->resprints.= $langs->trans('PlanStripe');
|
$this->resprints.= $langs->trans('PlanStripe');
|
||||||
$this->resprints.= '<td><td align="right">';
|
$this->resprints.= '<td><td align="right">';
|
||||||
// $this->resprints.= '<a href="'.$dolibarr_main_url_root.dol_buildpath('/dolipress/card.php?socid='.$object->id, 1).'">'.img_edit().'</a>';
|
// $this->resprints.= '<a href="'.$dolibarr_main_url_root.dol_buildpath('/dolipress/card.php?socid='.$object->id, 1).'">'.img_edit().'</a>';
|
||||||
$this->resprints.= '</td></tr></table>';
|
$this->resprints.= '</td></tr></table>';
|
||||||
$this->resprints.= '</td>';
|
$this->resprints.= '</td>';
|
||||||
$this->resprints.= '<td colspan="3">';
|
$this->resprints.= '<td colspan="3">';
|
||||||
$stripe=new Stripe($db);
|
$stripe=new Stripe($db);
|
||||||
if (7==4) {
|
if (7==4) {
|
||||||
$customer=$stripe->customerStripe($object->id,$stripe->getStripeAccount($service));
|
$customer=$stripe->customerStripe($object->id,$stripe->getStripeAccount($service));
|
||||||
$this->resprints.= $customer->id;
|
$this->resprints.= $customer->id;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* addMoreActionsButtons
|
||||||
|
*
|
||||||
|
* @param arra $parameters Parameters
|
||||||
|
* @param Object $object Object
|
||||||
|
* @param string $action action
|
||||||
|
* @return int 0
|
||||||
|
*/
|
||||||
function addMoreActionsButtons($parameters=false, &$object, &$action='')
|
function addMoreActionsButtons($parameters=false, &$object, &$action='')
|
||||||
{
|
{
|
||||||
global $db,$conf,$user,$langs,$form;
|
global $db,$conf,$user,$langs,$form;
|
||||||
@ -183,7 +197,8 @@ $this->resprints.= $langs->trans("NoStripe");
|
|||||||
$resteapayer = $object->total_ttc - $totalpaye;
|
$resteapayer = $object->total_ttc - $totalpaye;
|
||||||
// Request a direct debit order
|
// Request a direct debit order
|
||||||
if ($object->statut > Facture::STATUS_DRAFT && $object->statut < Facture::STATUS_ABANDONED && $object->paye == 0)
|
if ($object->statut > Facture::STATUS_DRAFT && $object->statut < Facture::STATUS_ABANDONED && $object->paye == 0)
|
||||||
{ $stripe=new Stripe($db);
|
{
|
||||||
|
$stripe=new Stripe($db);
|
||||||
if ($resteapayer > 0)
|
if ($resteapayer > 0)
|
||||||
{
|
{
|
||||||
if ($stripe->getStripeAccount($conf->entity)) // a modifier avec droit stripe
|
if ($stripe->getStripeAccount($conf->entity)) // a modifier avec droit stripe
|
||||||
@ -206,10 +221,10 @@ $this->resprints.= $langs->trans("NoStripe");
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (is_object($object) && $object->element == 'invoice_supplier'){
|
elseif (is_object($object) && $object->element == 'invoice_supplier'){
|
||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("StripeConnectPay")).'">'.$langs->trans("StripeConnectPay").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("StripeConnectPay")).'">'.$langs->trans("StripeConnectPay").'</a>';
|
||||||
}
|
}
|
||||||
elseif (is_object($object) && $object->element == 'member'){
|
elseif (is_object($object) && $object->element == 'member'){
|
||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("StripeAutoSubscription")).'">'.$langs->trans("StripeAutoSubscription").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("StripeAutoSubscription")).'">'.$langs->trans("StripeAutoSubscription").'</a>';
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user