26 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL', 1);
27 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
28 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
29 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
30 if (!defined(
'NOREQUIRESOC')) define(
'NOREQUIRESOC',
'1');
33 require
'../../main.inc.php';
34 require_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);
44 if ($user->socid > 0) {
45 if ($idprospect != $user->socid) {
51 $result =
restrictedArea($user,
'societe', $idprospect,
'&societe');
53 $permisstiontoupdate = $user->hasRight(
'societe',
'creer');
63 if ($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.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
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.