29if (!defined(
'NOTOKENRENEWAL')) {
30 define(
'NOTOKENRENEWAL', 1);
32if (!defined(
'NOREQUIREMENU')) {
33 define(
'NOREQUIREMENU',
'1');
35if (!defined(
'NOREQUIREHTML')) {
36 define(
'NOREQUIREHTML',
'1');
38if (!defined(
'NOREQUIREAJAX')) {
39 define(
'NOREQUIREAJAX',
'1');
41if (!defined(
'NOREQUIRESOC')) {
42 define(
'NOREQUIRESOC',
'1');
46require
'../../main.inc.php';
54require_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
58$action =
GETPOST(
'action',
'aZ09');
64if ($user->socid > 0) {
65 if ($idprospect != $user->socid) {
71$result =
restrictedArea($user,
'societe', $idprospect,
'&societe');
73$permisstiontoupdate = $user->hasRight(
'societe',
'creer');
83if ($action ===
"updatestatusprospect" && $permisstiontoupdate) {
84 $prospectstatic->client = 2;
85 $prospectstatic->loadCacheOfProspStatus();
91 $result = $prospect->fetch($idprospect);
95 $prospect->stcomm_id = $idstatus;
98 $updateResult = $prospect->update($prospect->id, $user);
100 if ($updateResult >= 0) {
101 $response =
img_action(
'', $prospectstatic->cacheprospectstatus[$idstatus][
'code'], $prospectstatic->cacheprospectstatus[$idstatus][
'picto'],
'class="inline-block valignmiddle paddingright pictoprospectstatus"');
103 dol_syslog(
'Failed to update prospect via update() method', LOG_ERR);
109 echo json_encode(array(
'img' => $response));
Class to manage customers or prospects.
Class to manage third parties objects (customers, suppliers, prospects...)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
img_action($titlealt, $numaction, $picto='', $moreatt='')
Show logo action.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.