27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
32$langs->loadLangs(array(
'orders',
'companies'));
34$action =
GETPOST(
'action',
'alpha');
35$cancel =
GETPOST(
'cancel',
'alpha');
40if ($user->socid > 0) {
41 $_socid = $user->socid;
46if ($user->socid > 0) {
50$hookmanager->initHooks(array(
'thirdpartyprice',
'globalcard'));
51$result =
restrictedArea($user,
'societe', $id,
'&societe',
'',
'fk_soc',
'rowid', 0);
58if ($action ==
'setpricelevel' && $user->hasRight(
'societe',
'creer')) {
61 $soc->setPriceLevel(
GETPOST(
"price_level"), $user);
63 header(
"Location: multiprix.php?id=".$id);
74$userstatic =
new User($db);
79 $objsoc->id = $_socid;
80 $objsoc->fetch($_socid);
86 if ($objsoc->client == 1) {
87 $tabchoice =
'customer';
89 if ($objsoc->client == 2) {
90 $tabchoice =
'prospect';
93 print
'<form method="POST" action="multiprix.php?id='.$objsoc->id.
'">';
94 print
'<input type="hidden" name="token" value="'.newToken().
'">';
95 print
'<input type="hidden" name="action" value="setpricelevel">';
97 print
dol_get_fiche_head($head, $tabchoice, $langs->trans(
"ThirdParty"), 0,
'company');
99 print
'<table class="border centpercent tableforfield">';
101 print
'<tr><td class="titlefieldcreate">';
102 print $langs->trans(
"PriceLevel").
'</td><td>'.$objsoc->price_level.
"</td></tr>";
105 print $langs->trans(
"NewValue").
'</td><td>';
106 print
'<select name="price_level" class="flat">';
107 for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
108 print
'<option value="'.$i.
'"';
109 if ($i == $objsoc->price_level) {
113 $keyforlabel =
'PRODUIT_MULTIPRICES_LABEL'.$i;
126 print $form->buttonsSaveCancel(
"Save",
'');
137 $sql =
"SELECT rc.rowid,rc.price_level, rc.datec as dc, u.rowid as uid, u.login";
138 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe_prices as rc, ".MAIN_DB_PREFIX.
"user as u";
139 $sql .=
" WHERE rc.fk_soc = ".((int) $objsoc->id);
140 $sql .=
" AND u.rowid = rc.fk_user_author";
141 $sql .=
" ORDER BY rc.datec DESC";
143 $resql = $db->query($sql);
145 print
'<table class="noborder centpercent">';
146 print
'<tr class="liste_titre">';
147 print
'<td>'.$langs->trans(
"Date").
'</td>';
148 print
'<td>'.$langs->trans(
"PriceLevel").
'</td>';
149 print
'<td class="right">'.$langs->trans(
"User").
'</td>';
152 $num = $db->num_rows($resql);
155 $obj = $db->fetch_object($resql);
157 print
'<tr class="oddeven">';
158 print
'<td>'.dol_print_date($db->jdate($obj->dc),
"dayhour").
'</td>';
159 print
'<td>'.$obj->price_level.
' </td>';
160 $userstatic->id = $obj->uid;
161 $userstatic->lastname = $obj->login;
162 print
'<td class="right">'.$userstatic->getNomUrl(1).
'</td>';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.