26if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL', 1);
27if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
28if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
29if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
30if (!defined(
'NOREQUIRESOC')) define(
'NOREQUIRESOC',
'1');
33require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
36$idstatus =
GETPOST(
'id',
'int');
37$idprospect =
GETPOST(
'prospectid',
'int');
38$action =
GETPOST(
'action',
'aZ09');
40$prospectstatic =
new Client($db);
44if ($user->socid > 0) {
45 if ($idprospect != $user->socid) {
51$result =
restrictedArea($user,
'societe', $idprospect,
'&societe');
53$permisstiontoupdate = $user->hasRight(
'societe',
'creer');
63if ($action ===
"updatestatusprospect" && $permisstiontoupdate) {
64 $prospectstatic->client = 2;
65 $prospectstatic->loadCacheOfProspStatus();
69 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"societe SET ";
70 $sql .=
"fk_stcomm=".(int) $db->escape($idstatus);
71 $sql .=
" WHERE rowid = ".(int) $db->escape($idprospect);
73 $resql = $db->query($sql);
78 $num = $db->affected_rows($resql);
79 $response =
img_action(
'', $prospectstatic->cacheprospectstatus[$idstatus][
'code'], $prospectstatic->cacheprospectstatus[$idstatus][
'picto'],
'class="inline-block valignmiddle paddingright pictoprospectstatus"');
82 echo json_encode(array(
'img' => $response));
Class to manage customers or prospects.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
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.