Debug v15
This commit is contained in:
parent
47c131af74
commit
0017c15974
@ -2014,15 +2014,15 @@ if ($action == 'create') {
|
|||||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
|
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
|
||||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1);
|
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
$morehtmlref .= '<br><span class="hideonsmartphone">'.$langs->trans('ThirdParty').' : </span>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
|
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
|
||||||
}
|
}
|
||||||
// Project
|
// Project
|
||||||
if (!empty($conf->projet->enabled)) {
|
if (!empty($conf->projet->enabled)) {
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
$morehtmlref .= '<br><span class="paddingrightonly">'.$langs->trans('Project').'</span>';
|
||||||
if (!$usercancreate) {
|
if ($usercancreate) {
|
||||||
if ($action != 'classify') {
|
if ($action != 'classify') {
|
||||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||||
}
|
}
|
||||||
@ -2041,7 +2041,7 @@ if ($action == 'create') {
|
|||||||
if (!empty($object->fk_project)) {
|
if (!empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
$morehtmlref .= ': '.$proj->getNomUrl(1);
|
||||||
if ($proj->title) {
|
if ($proj->title) {
|
||||||
$morehtmlref .= ' - '.$proj->title;
|
$morehtmlref .= ' - '.$proj->title;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/bookmarks_page.php
|
* \file htdocs/core/bookmarks_page.php
|
||||||
* \brief File to return a page with the complete list of bookmarks (all search input fields)
|
* \brief File to return a page with the complete list of bookmarks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||||
@ -45,7 +45,7 @@ if (GETPOST('lang', 'aZ09')) {
|
|||||||
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("main");
|
$langs->loadLangs(array("bookmarks"));
|
||||||
|
|
||||||
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
||||||
$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
||||||
@ -57,7 +57,7 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
|||||||
|
|
||||||
$title = $langs->trans("Bookmarks");
|
$title = $langs->trans("Bookmarks");
|
||||||
|
|
||||||
// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests
|
// URL http://mydolibarr/core/bookmarks_page?dol_use_jmobile=1 can be used for tests
|
||||||
$head = '<!-- Bookmarks access -->'."\n";
|
$head = '<!-- Bookmarks access -->'."\n";
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
$arrayofcss = array();
|
$arrayofcss = array();
|
||||||
@ -69,8 +69,6 @@ print '<body>'."\n";
|
|||||||
print '<div>';
|
print '<div>';
|
||||||
//print '<br>';
|
//print '<br>';
|
||||||
|
|
||||||
$nbofsearch = 0;
|
|
||||||
|
|
||||||
// Instantiate hooks of thirdparty module
|
// Instantiate hooks of thirdparty module
|
||||||
$hookmanager->initHooks(array('bookmarks'));
|
$hookmanager->initHooks(array('bookmarks'));
|
||||||
|
|
||||||
@ -78,17 +76,18 @@ $hookmanager->initHooks(array('bookmarks'));
|
|||||||
$bookmarkList = '';
|
$bookmarkList = '';
|
||||||
$searchForm = '';
|
$searchForm = '';
|
||||||
|
|
||||||
$arrayresult = array();
|
|
||||||
//include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
|
|
||||||
|
|
||||||
|
if (empty($conf->bookmarks->enabled)) {
|
||||||
|
$langs->load("admin");
|
||||||
// Menu with list of bookmarks
|
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).'</span>';
|
||||||
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
$bookmarkList .= '<br><br>';
|
||||||
$sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)";
|
} else {
|
||||||
$sql .= " AND entity IN (".getEntity('bookmarks').")";
|
// Menu with list of bookmarks
|
||||||
$sql .= " ORDER BY position";
|
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
||||||
if ($resql = $db->query($sql)) {
|
$sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)";
|
||||||
|
$sql .= " AND entity IN (".getEntity('bookmarks').")";
|
||||||
|
$sql .= " ORDER BY position";
|
||||||
|
if ($resql = $db->query($sql)) {
|
||||||
$bookmarkList = '<div id="dropdown-bookmarks-list" class="start">';
|
$bookmarkList = '<div id="dropdown-bookmarks-list" class="start">';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
|
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
|
||||||
@ -97,13 +96,23 @@ if ($resql = $db->query($sql)) {
|
|||||||
$bookmarkList .= '</a>';
|
$bookmarkList .= '</a>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
if ($i == 0) {
|
||||||
|
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("NoBookmarks").'</span>';
|
||||||
|
$bookmarkList .= '<br><br>';
|
||||||
|
|
||||||
|
$newcardbutton = '';
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer));
|
||||||
|
|
||||||
|
$bookmarkList .= '<center>'.$newcardbutton.'</center>';
|
||||||
|
}
|
||||||
$bookmarkList .= '</div>';
|
$bookmarkList .= '</div>';
|
||||||
|
|
||||||
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Execute hook printBookmarks
|
// Execute hook printBookmarks
|
||||||
$parameters = array('bookmarks'=>$bookmarkList);
|
$parameters = array('bookmarks'=>$bookmarkList);
|
||||||
|
|||||||
@ -5088,8 +5088,7 @@ class Form
|
|||||||
if ($selected) {
|
if ($selected) {
|
||||||
$projet = new Project($this->db);
|
$projet = new Project($this->db);
|
||||||
$projet->fetch($selected);
|
$projet->fetch($selected);
|
||||||
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$selected.'">'.$projet->title.'</a>';
|
$out .= $projet->getNomUrl(1, '', 1);
|
||||||
$out .= $projet->getNomUrl(0, '', 1);
|
|
||||||
} else {
|
} else {
|
||||||
$out .= " ";
|
$out .= " ";
|
||||||
}
|
}
|
||||||
|
|||||||
147
htdocs/core/multicompany_page.php
Normal file
147
htdocs/core/multicompany_page.php
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This file is a modified version of datepicker.php from phpBSM to fix some
|
||||||
|
* bugs, to add new features and to dramatically increase speed.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/multicompany_page.php
|
||||||
|
* \brief File to return a page with the list of all entities user can switch to
|
||||||
|
*/
|
||||||
|
|
||||||
|
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||||
|
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
|
||||||
|
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||||
|
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
|
||||||
|
if (!defined('NOCSRFCHECK')) {
|
||||||
|
define('NOCSRFCHECK', 1);
|
||||||
|
}
|
||||||
|
if (!defined('NOTOKENRENEWAL')) {
|
||||||
|
define('NOTOKENRENEWAL', 1);
|
||||||
|
}
|
||||||
|
//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
|
||||||
|
if (!defined('NOREQUIREMENU')) {
|
||||||
|
define('NOREQUIREMENU', 1);
|
||||||
|
}
|
||||||
|
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||||
|
|
||||||
|
require_once '../main.inc.php';
|
||||||
|
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$entityid = GETPOST('entity', 'int');
|
||||||
|
$backtourl = GETPOST('backtourl');
|
||||||
|
if (empty($backtourl)) {
|
||||||
|
$backtourl = DOL_URL_ROOT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GETPOST('lang', 'aZ09')) {
|
||||||
|
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
||||||
|
}
|
||||||
|
|
||||||
|
$langs->load("main");
|
||||||
|
|
||||||
|
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
||||||
|
$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (GETPOST('acction', 'aZ') == 'switchentity') {
|
||||||
|
if (is_object($mc)) {
|
||||||
|
$mc->switchEntity($entityid);
|
||||||
|
}
|
||||||
|
|
||||||
|
header("Location: ".$backtourl);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$title = $langs->trans("Multicompanies");
|
||||||
|
|
||||||
|
// URL http://mydolibarr/core/multicompany_page?dol_use_jmobile=1 can be used for tests
|
||||||
|
$head = '<!-- Multicompany access -->'."\n";
|
||||||
|
$arrayofjs = array();
|
||||||
|
$arrayofcss = array();
|
||||||
|
top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
|
||||||
|
print '<body>'."\n";
|
||||||
|
print '<div>';
|
||||||
|
//print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($conf->multicompany->enabled)) {
|
||||||
|
$langs->load("admin");
|
||||||
|
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("MultiCompany")).'</span>';
|
||||||
|
$bookmarkList .= '<br><br>';
|
||||||
|
} else {
|
||||||
|
// Instantiate hooks of thirdparty module
|
||||||
|
$hookmanager->initHooks(array('multicompany'));
|
||||||
|
|
||||||
|
// Define $bookmarks
|
||||||
|
$multicompanyList = '';
|
||||||
|
$searchForm = '';
|
||||||
|
|
||||||
|
|
||||||
|
if (is_object($mc)) {
|
||||||
|
$listofentities = $mc->getEntitiesList($user->login, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($listofentities as $entityid => $entitycursor) {
|
||||||
|
$url = DOL_URL_ROOT.'/core/multicompany_page.php?action=switchentity&token='.newToken().'&entity='.((int) $entityid).($backtourl ? '&backtourl='.urlencode($backtourl) : '');
|
||||||
|
$multicompanyList .= '<a class="dropdown-item multicompany-item'.(strpos($url, 'http') === 0 ? ' multicompany-item-external' : '').'" id="multicompany-item-'.$id.'" data-id="'.$id.'" href="'.dol_escape_htmltag($url).'">';
|
||||||
|
$multicompanyList .= dol_escape_htmltag($entitycursor);
|
||||||
|
$multicompanyList .= '</a>';
|
||||||
|
}
|
||||||
|
$multicompanyList .= '</div>';
|
||||||
|
|
||||||
|
$searchForm .= '<input name="bookmark" id="top-multicompany-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Entity').'" autocomplete="off" >';
|
||||||
|
|
||||||
|
|
||||||
|
// Execute hook printBookmarks
|
||||||
|
$parameters = array('multicompany'=>$multicompanyList);
|
||||||
|
$reshook = $hookmanager->executeHooks('printMultiCompanyEntities', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$multicompanyList .= $hookmanager->resPrint;
|
||||||
|
} else {
|
||||||
|
$multicompanyList = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print "\n";
|
||||||
|
print "<!-- Begin Multicompany list -->\n";
|
||||||
|
print '<div class="center"><div class="center" style="padding: 6px;">';
|
||||||
|
print '<style>.menu_titre { padding-top: 7px; }</style>';
|
||||||
|
print '<div id="blockvmenusearch" class="tagtable center searchpage">'."\n";
|
||||||
|
print $multicompanyList;
|
||||||
|
print '</div>'."\n";
|
||||||
|
print '</div></div>';
|
||||||
|
print "\n<!-- End SearchForm -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
print '</body></html>'."\n";
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -19,3 +19,4 @@ UseAnExternalHttpLinkOrRelativeDolibarrLink=Use an external/absolute link (https
|
|||||||
ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choose if the linked page should open in the current tab or a new tab
|
ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choose if the linked page should open in the current tab or a new tab
|
||||||
BookmarksManagement=Bookmarks management
|
BookmarksManagement=Bookmarks management
|
||||||
BookmarksMenuShortCut=Ctrl + shift + m
|
BookmarksMenuShortCut=Ctrl + shift + m
|
||||||
|
NoBookmarks=No bookmarks defined
|
||||||
|
|||||||
@ -89,11 +89,11 @@ IdProposal=Proposal ID
|
|||||||
IdProduct=Product ID
|
IdProduct=Product ID
|
||||||
PrParentLine=Proposal Parent Line
|
PrParentLine=Proposal Parent Line
|
||||||
LineBuyPriceHT=Buy Price Amount net of tax for line
|
LineBuyPriceHT=Buy Price Amount net of tax for line
|
||||||
SignPropal=Sign proposal
|
SignPropal=Accept proposal
|
||||||
RefusePropal=Refuse proposal
|
RefusePropal=Refuse proposal
|
||||||
Sign=Sign
|
Sign=Sign
|
||||||
|
PropalAlreadySigned=Proposal already accepted
|
||||||
PropalAlreadyRefused=Proposal already refused
|
PropalAlreadyRefused=Proposal already refused
|
||||||
PropalAlreadySigned=Proposal already signed
|
PropalSigned=Proposal accepted
|
||||||
PropalSigned=Proposal signed
|
|
||||||
PropalRefused=Proposal refused
|
PropalRefused=Proposal refused
|
||||||
ConfirmRefusePropal=Are you sure you want to refuse this commercial proposal?
|
ConfirmRefusePropal=Are you sure you want to refuse this commercial proposal?
|
||||||
|
|||||||
@ -1183,7 +1183,7 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
$label = '';
|
$label = '';
|
||||||
if ($option != 'nolink') {
|
if ($option != 'nolink') {
|
||||||
$label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Project").'</u>';
|
$label = img_picto('', $this->picto, 'class="pictofixedwidth"').' <u class="paddingrightonly">'.$langs->trans("Project").'</u>';
|
||||||
}
|
}
|
||||||
if (isset($this->status)) {
|
if (isset($this->status)) {
|
||||||
$label .= ' '.$this->getLibStatut(5);
|
$label .= ' '.$this->getLibStatut(5);
|
||||||
@ -1252,7 +1252,7 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
$result .= $linkstart;
|
$result .= $linkstart;
|
||||||
if ($withpicto) {
|
if ($withpicto) {
|
||||||
$result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
$result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip pictofixedwidth"'), 0, 0, $notooltip ? 0 : 1);
|
||||||
}
|
}
|
||||||
if ($withpicto != 2) {
|
if ($withpicto != 2) {
|
||||||
$result .= $this->ref;
|
$result .= $this->ref;
|
||||||
|
|||||||
@ -61,6 +61,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors",
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$refusepropal = GETPOST('refusepropal', 'alpha');
|
$refusepropal = GETPOST('refusepropal', 'alpha');
|
||||||
|
$message = GETPOST('message', 'aZ09');
|
||||||
|
|
||||||
// Input are:
|
// Input are:
|
||||||
// type ('invoice','order','contractline'),
|
// type ('invoice','order','contractline'),
|
||||||
@ -120,25 +121,33 @@ $creditor = $mysoc->name;
|
|||||||
$object = new Propal($db);
|
$object = new Propal($db);
|
||||||
$object->fetch(0, $ref);
|
$object->fetch(0, $ref);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'confirm_refusepropal') {
|
if ($action == 'confirm_refusepropal') {
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||||
$sql .= " SET fk_statut = ".((int) $object::STATUS_NOTSIGNED).", note_private = '".$object->note_private."', date_signature='".$db->idate(dol_now())."'";
|
$sql .= " SET fk_statut = ".((int) $object::STATUS_NOTSIGNED).", note_private = '".$db->escape($object->note_private)."', date_signature='".$db->idate(dol_now())."'";
|
||||||
$sql .= " WHERE rowid = ".((int) $object->id);
|
$sql .= " WHERE rowid = ".((int) $object->id);
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage("PropalRefused");
|
|
||||||
|
$message = 'refused';
|
||||||
|
setEventMessages("PropalRefused", null, 'warning');
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->fetch(0, $ref);
|
$object->fetch(0, $ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,7 +376,7 @@ if ($action == "dosign" && empty($cancel)) {
|
|||||||
success: function(response) {
|
success: function(response) {
|
||||||
if(response == "success"){
|
if(response == "success"){
|
||||||
console.log("Success on saving signature");
|
console.log("Success on saving signature");
|
||||||
window.location.replace("'.$_SERVER["SELF"].'?ref='.$ref.'");
|
window.location.replace("'.$_SERVER["SELF"].'?ref='.$ref.'&message=signed");
|
||||||
}else{
|
}else{
|
||||||
console.error(response);
|
console.error(response);
|
||||||
}
|
}
|
||||||
@ -390,10 +399,18 @@ if ($action == "dosign" && empty($cancel)) {
|
|||||||
} else {
|
} else {
|
||||||
if ($object->status == $object::STATUS_SIGNED) {
|
if ($object->status == $object::STATUS_SIGNED) {
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
if ($message == 'signed') {
|
||||||
|
print '<span class="ok">'.$langs->trans("PropalSigned").'</span>';
|
||||||
|
} else {
|
||||||
print '<span class="ok">'.$langs->trans("PropalAlreadySigned").'</span>';
|
print '<span class="ok">'.$langs->trans("PropalAlreadySigned").'</span>';
|
||||||
|
}
|
||||||
} elseif ($object->status == $object::STATUS_NOTSIGNED) {
|
} elseif ($object->status == $object::STATUS_NOTSIGNED) {
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
if ($message == 'refused') {
|
||||||
|
print '<span class="ok">'.$langs->trans("PropalRefused").'</span>';
|
||||||
|
} else {
|
||||||
print '<span class="warning">'.$langs->trans("PropalAlreadyRefused").'</span>';
|
print '<span class="warning">'.$langs->trans("PropalAlreadyRefused").'</span>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<input type="submit" class="butAction small wraponsmartphone marginbottomonly marginleftonly marginrightonly reposition" value="'.$langs->trans("SignPropal").'">';
|
print '<input type="submit" class="butAction small wraponsmartphone marginbottomonly marginleftonly marginrightonly reposition" value="'.$langs->trans("SignPropal").'">';
|
||||||
print '<input name="refusepropal" type="submit" class="butActionDelete small wraponsmartphone marginbottomonly marginleftonly marginrightonly" value="'.$langs->trans("RefusePropal").'">';
|
print '<input name="refusepropal" type="submit" class="butActionDelete small wraponsmartphone marginbottomonly marginleftonly marginrightonly" value="'.$langs->trans("RefusePropal").'">';
|
||||||
|
|||||||
@ -83,6 +83,21 @@ if (empty($endpoint_secret)) {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS)) {
|
||||||
|
// We set the user to use for all ipn actions in Dolibarr
|
||||||
|
$user = new User($db);
|
||||||
|
$user->fetch($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS);
|
||||||
|
$user->getrights();
|
||||||
|
} else {
|
||||||
|
print 'Error: Setup of module Stripe not complete for mode '.$service.'. The STRIPE_USER_ACCOUNT_FOR_ACTIONS is not defined.';
|
||||||
|
http_response_code(400); // PHP 5.4 or greater
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO Add a check on a security key
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -110,10 +125,6 @@ try {
|
|||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
|
|
||||||
// TODO Do we really need a user in setup just to have a name to fill an email topic when it is a technical system notification email
|
|
||||||
$user = new User($db);
|
|
||||||
$user->fetch($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS);
|
|
||||||
$user->getrights();
|
|
||||||
|
|
||||||
if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled) && is_object($mc)) {
|
if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled) && is_object($mc)) {
|
||||||
$sql = "SELECT entity";
|
$sql = "SELECT entity";
|
||||||
@ -276,11 +287,11 @@ if ($event->type == 'payout.created') {
|
|||||||
|
|
||||||
$ret = $mailfile->sendfile();
|
$ret = $mailfile->sendfile();
|
||||||
|
|
||||||
http_response_code(200); // PHP 5.4 or greater
|
http_response_code(200);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
http_response_code(500); // PHP 5.4 or greater
|
http_response_code(500);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} elseif ($event->type == 'customer.source.created') {
|
} elseif ($event->type == 'customer.source.created') {
|
||||||
@ -385,4 +396,4 @@ if ($event->type == 'payout.created') {
|
|||||||
// This event is deprecated.
|
// This event is deprecated.
|
||||||
}
|
}
|
||||||
|
|
||||||
http_response_code(200); // PHP 5.4 or greater
|
http_response_code(200);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user