clean indent
This commit is contained in:
parent
ac6da28135
commit
16f58f1eee
@ -79,7 +79,7 @@ if (GETPOST('action', 'alpha') == 'set')
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_DIRECT_PAYMENT", GETPOST('TAKEPOS_DIRECT_PAYMENT', 'int'), 'int', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_CUSTOM_RECEIPT", GETPOST('TAKEPOS_CUSTOM_RECEIPT', 'int'), 'int', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if ($conf->global->TAKEPOS_ORDER_NOTES==1)
|
||||
{
|
||||
@ -247,15 +247,15 @@ $formmail = new FormMail($db);
|
||||
$nboftemplates = $formmail->fetchAllEMailTemplate('facture_send', $user, null, -1); // We set lang=null to get in priority record with no lang
|
||||
//$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, '');
|
||||
$arrayofmessagename=array();
|
||||
if (is_array($formmail->lines_model))
|
||||
{
|
||||
foreach($formmail->lines_model as $modelmail)
|
||||
{
|
||||
//var_dump($modelmail);
|
||||
$moreonlabel='';
|
||||
if (! empty($arrayofmessagename[$modelmail->label])) $moreonlabel=' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
|
||||
$arrayofmessagename[$modelmail->label]=$langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
|
||||
}
|
||||
if (is_array($formmail->lines_model)) {
|
||||
foreach($formmail->lines_model as $modelmail) {
|
||||
//var_dump($modelmail);
|
||||
$moreonlabel='';
|
||||
if (! empty($arrayofmessagename[$modelmail->label])) {
|
||||
$moreonlabel=' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
|
||||
}
|
||||
$arrayofmessagename[$modelmail->label]=$langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
|
||||
}
|
||||
}
|
||||
//var_dump($arraydefaultmessage);
|
||||
//var_dump($arrayofmessagename);
|
||||
|
||||
@ -166,12 +166,12 @@ if (! empty($conf->stock->enabled))
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td>';
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1);
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) {
|
||||
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
print $langs->trans("Yes").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch').'</span>';
|
||||
|
||||
@ -157,8 +157,7 @@ $( document ).ready(function() {
|
||||
$('#'+val.label).draggable().bind('click', function(){
|
||||
$(this).focus();
|
||||
})
|
||||
<?php }
|
||||
else {?>
|
||||
<?php } else {?>
|
||||
$('body').append('<div class="tablediv" onclick="LoadPlace('+val.rowid+');" style="position: absolute; left: '+val.leftpos+'%; top: '+val.toppos+'%;" id="tablename'+val.rowid+'">'+val.label+'</div>');
|
||||
<?php } ?>
|
||||
});
|
||||
@ -168,13 +167,13 @@ $( document ).ready(function() {
|
||||
</script>
|
||||
</head>
|
||||
<body style="overflow: hidden">
|
||||
<?php if ($user->admin){?>
|
||||
<?php if ($user->admin) {?>
|
||||
<div style="position: absolute; left: 0.1%; top: 0.8%; width:8%; height:11%;">
|
||||
<?php if ($mode=="edit"){?>
|
||||
<?php if ($mode=="edit"){?>
|
||||
<a id="add" onclick="window.location.href='floors.php?mode=edit&action=add&floor=<?php echo $floor;?>';"><?php echo $langs->trans("AddTable"); ?></a>
|
||||
<?php } else { ?>
|
||||
<?php } else { ?>
|
||||
<a onclick="window.location.href='floors.php?mode=edit&floor=<?php echo $floor;?>';"><?php echo $langs->trans("Edit"); ?></a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php }
|
||||
?>
|
||||
|
||||
@ -223,7 +223,7 @@ $numpad=$conf->global->TAKEPOS_NUMPAD;
|
||||
if ($paycode == 'LIQ') $paycode = 'cash';
|
||||
if ($paycode == 'CB') $paycode = 'card';
|
||||
if ($paycode == 'CHQ') $paycode = 'cheque';
|
||||
?>
|
||||
?>
|
||||
<button type="button" class="calcbutton2" onclick="Validate('<?php echo $langs->trans($paycode); ?>');"><?php echo $langs->trans("PaymentTypeShort".$paiements[0]->code); ?></button>
|
||||
<?php } else { ?>
|
||||
<button type="button" class="calcbutton2"><?php echo $langs->trans("NoPaimementModesDefined");?></button>
|
||||
@ -236,11 +236,11 @@ $numpad=$conf->global->TAKEPOS_NUMPAD;
|
||||
if ($paycode == 'LIQ') $paycode = 'cash';
|
||||
if ($paycode == 'CB') $paycode = 'card';
|
||||
if ($paycode == 'CHQ') $paycode = 'cheque';
|
||||
?>
|
||||
?>
|
||||
<button type="button" class="calcbutton2" onclick="Validate('<?php echo $langs->trans($paycode); ?>');"><?php echo $langs->trans("PaymentTypeShort".$paiements[1]->code); ?></button>
|
||||
<?php } else {
|
||||
$button = array_pop($action_buttons);
|
||||
?>
|
||||
$button = array_pop($action_buttons);
|
||||
?>
|
||||
<button type="button" class="calcbutton2" onclick="<?php echo $button["function"];?>"><span <?php echo $button["span"];?>><?php echo $button["text"];?></span></button>
|
||||
<?php } ?>
|
||||
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "1"; else print "0.10";?>);"><?php if ($numpad==0) print "1"; else print "0.10";?></button>
|
||||
@ -251,12 +251,11 @@ $button = array_pop($action_buttons);
|
||||
if ($paycode == 'LIQ') $paycode = 'cash';
|
||||
if ($paycode == 'CB') $paycode = 'card';
|
||||
if ($paycode == 'CHQ') $paycode = 'cheque';
|
||||
?>
|
||||
?>
|
||||
<button type="button" class="calcbutton2" onclick="Validate('<?php echo $langs->trans($paycode); ?>');"><?php echo $langs->trans("PaymentTypeShort".$paiements[2]->code); ?></button>
|
||||
<?php } else { ?>
|
||||
<?php
|
||||
$button = array_pop($action_buttons);
|
||||
?>
|
||||
<?php } else {
|
||||
$button = array_pop($action_buttons);
|
||||
?>
|
||||
<button type="button" class="calcbutton2" onclick="<?php echo $button["function"];?>"><span <?php echo $button["span"];?>><?php echo $button["text"];?></span></button>
|
||||
<?php } ?>
|
||||
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "0"; else print "0.01";?>);"><?php if ($numpad==0) print "0"; else print "0.01";?></button>
|
||||
@ -265,17 +264,17 @@ $button = array_pop($action_buttons);
|
||||
<?php
|
||||
$i=3;
|
||||
while($i < count($paiements)){
|
||||
?>
|
||||
?>
|
||||
<button type="button" class="calcbutton2" onclick="Validate('<?php echo $langs->trans($paiements[$i]->code); ?>');"><?php echo $langs->trans("PaymentTypeShort".$paiements[$i]->code); ?></button>
|
||||
<?php
|
||||
<?php
|
||||
$i=$i+1;
|
||||
}
|
||||
$class=($i==3)?"calcbutton3":"calcbutton2";
|
||||
foreach($action_buttons as $button){
|
||||
$newclass = $class.($button["class"]?" ".$button["class"]:"");
|
||||
?>
|
||||
?>
|
||||
<button type="button" class="<?php echo $newclass;?>" onclick="<?php echo $button["function"];?>"><span <?php echo $button["span"];?>><?php echo $button["text"];?></span></button>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@ -130,16 +130,17 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME
|
||||
<?php
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<tr>
|
||||
<td><?php if (!empty($line->product_label)) echo $line->product_label;
|
||||
else echo $line->description;?>
|
||||
<td>
|
||||
<?php if (!empty($line->product_label)) echo $line->product_label;
|
||||
else echo $line->description;?>
|
||||
</td>
|
||||
<td class="right"><?php echo $line->qty;?></td>
|
||||
<td class="right"><?php echo $line->total_ttc/$line->qty;?></td>
|
||||
<td class="right"><?php echo price($line->total_ttc);?></td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
@ -150,30 +151,28 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME
|
||||
<th class="right"><?php echo $langs->trans("TotalHT");?></th>
|
||||
<td class="right"><?php echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
||||
</tr>
|
||||
<?php if($conf->global->TAKEPOS_TICKET_VAT_GROUPPED):?>
|
||||
<?php
|
||||
<?php if($conf->global->TAKEPOS_TICKET_VAT_GROUPPED) {
|
||||
$vat_groups = array();
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
if(!array_key_exists($line->tva_tx, $vat_groups)){
|
||||
if(!array_key_exists($line->tva_tx, $vat_groups)) {
|
||||
$vat_groups[$line->tva_tx] = 0;
|
||||
}
|
||||
$vat_groups[$line->tva_tx] += $line->total_tva;
|
||||
}
|
||||
foreach($vat_groups as $key => $val){
|
||||
?>
|
||||
foreach($vat_groups as $key => $val) {
|
||||
?>
|
||||
<tr>
|
||||
<th align="right"><?php echo $langs->trans("VAT").' '.vatrate($key, 1);?></th>
|
||||
<td align="right"><?php echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php else: ?>
|
||||
} else { ?>
|
||||
<tr>
|
||||
<th class="right"><?php echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th class="right"><?php echo ''.$langs->trans("TotalTTC").'</th><td class="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
||||
</tr>
|
||||
|
||||
@ -747,7 +747,7 @@ $menus[$r++]=array('title'=>'<span class="fa fa-sign-out-alt paddingrightonly"><
|
||||
print '<input type="text" id="search" name="search" onkeyup="Search2();" style="width:80%;font-size: 150%;" placeholder="'.$langs->trans("Search").'" autofocus> ';
|
||||
print '<a class="marginleftonly hideonsmartphone" onclick="ClearSearch();">'.img_picto('', 'searchclear').'</a>';
|
||||
print '</div>';
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -759,7 +759,7 @@ $menus[$r++]=array('title'=>'<span class="fa fa-sign-out-alt paddingrightonly"><
|
||||
$count=0;
|
||||
while ($count < $MAXCATEG)
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<div class="wrapper" <?php if ($count==($MAXCATEG-2)) echo 'onclick="MoreCategories(\'less\');"'; elseif ($count==($MAXCATEG-1)) echo 'onclick="MoreCategories(\'more\');"'; else echo 'onclick="LoadProducts('.$count.');"';?> id="catdiv<?php echo $count;?>">
|
||||
<?php
|
||||
if ($count==($MAXCATEG-2)) {
|
||||
@ -782,8 +782,8 @@ $menus[$r++]=array('title'=>'<span class="fa fa-sign-out-alt paddingrightonly"><
|
||||
<?php } ?>
|
||||
<div class="catwatermark" id='catwatermark<?php echo $count;?>'>+</div>
|
||||
</div>
|
||||
<?php
|
||||
$count++;
|
||||
<?php
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@ -794,7 +794,7 @@ $menus[$r++]=array('title'=>'<span class="fa fa-sign-out-alt paddingrightonly"><
|
||||
$count=0;
|
||||
while ($count < $MAXPRODUCT)
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<div class="wrapper2" id='prodiv<?php echo $count;?>' <?php if ($count==($MAXPRODUCT-2)) {?> onclick="MoreProducts('less');" <?php } if ($count==($MAXPRODUCT-1)) {?> onclick="MoreProducts('more');" <?php } else echo 'onclick="ClickProduct('.$count.');"';?>>
|
||||
<?php
|
||||
if ($count==($MAXPRODUCT-2)) {
|
||||
@ -817,7 +817,7 @@ $menus[$r++]=array('title'=>'<span class="fa fa-sign-out-alt paddingrightonly"><
|
||||
<?php } ?>
|
||||
<div class="catwatermark" id='prowatermark<?php echo $count;?>'>+</div>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
|
||||
@ -72,7 +72,7 @@ class Users extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
if(! DolibarrApiAccess::$user->rights->user->user->lire) {
|
||||
throw new RestException(401, "You are not allowed to read list of users");
|
||||
throw new RestException(401, "You are not allowed to read list of users");
|
||||
}
|
||||
|
||||
// case of external user, $societe param is ignored and replaced by user's socid
|
||||
@ -226,10 +226,10 @@ class Users extends DolibarrApi
|
||||
if ($field == 'statut') {
|
||||
$result = $this->useraccount->setstatus($value);
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error);
|
||||
throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error);
|
||||
}
|
||||
} else {
|
||||
$this->useraccount->$field = $value;
|
||||
$this->useraccount->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ if ($id > 0)
|
||||
// Edit mode
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if ($user->admin)
|
||||
{
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -81,138 +82,138 @@ if (! is_array($user_arbo) && $user_arbo < 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Define fulltree array
|
||||
$fulltree=$user_arbo;
|
||||
//var_dump($fulltree);
|
||||
// Define data (format for treeview)
|
||||
$data=array();
|
||||
$data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>'');
|
||||
foreach($fulltree as $key => $val)
|
||||
{
|
||||
$userstatic->id=$val['id'];
|
||||
$userstatic->ref=$val['label'];
|
||||
$userstatic->login=$val['login'];
|
||||
$userstatic->firstname=$val['firstname'];
|
||||
$userstatic->lastname=$val['lastname'];
|
||||
$userstatic->statut=$val['statut'];
|
||||
$userstatic->email=$val['email'];
|
||||
$userstatic->gender=$val['gender'];
|
||||
$userstatic->societe_id=$val['fk_soc'];
|
||||
$userstatic->admin=$val['admin'];
|
||||
$userstatic->entity=$val['entity'];
|
||||
$userstatic->photo=$val['photo'];
|
||||
// Define fulltree array
|
||||
$fulltree=$user_arbo;
|
||||
//var_dump($fulltree);
|
||||
// Define data (format for treeview)
|
||||
$data=array();
|
||||
$data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>'');
|
||||
foreach($fulltree as $key => $val)
|
||||
{
|
||||
$userstatic->id=$val['id'];
|
||||
$userstatic->ref=$val['label'];
|
||||
$userstatic->login=$val['login'];
|
||||
$userstatic->firstname=$val['firstname'];
|
||||
$userstatic->lastname=$val['lastname'];
|
||||
$userstatic->statut=$val['statut'];
|
||||
$userstatic->email=$val['email'];
|
||||
$userstatic->gender=$val['gender'];
|
||||
$userstatic->societe_id=$val['fk_soc'];
|
||||
$userstatic->admin=$val['admin'];
|
||||
$userstatic->entity=$val['entity'];
|
||||
$userstatic->photo=$val['photo'];
|
||||
|
||||
$entity=$val['entity'];
|
||||
$entitystring='';
|
||||
$entity=$val['entity'];
|
||||
$entitystring='';
|
||||
|
||||
// TODO Set of entitystring should be done with a hook
|
||||
if (! empty($conf->multicompany->enabled) && is_object($mc))
|
||||
{
|
||||
if (empty($entity))
|
||||
{
|
||||
$entitystring=$langs->trans("AllEntities");
|
||||
}
|
||||
else
|
||||
{
|
||||
$mc->getInfo($entity);
|
||||
$entitystring=$mc->label;
|
||||
}
|
||||
}
|
||||
// TODO Set of entitystring should be done with a hook
|
||||
if (! empty($conf->multicompany->enabled) && is_object($mc))
|
||||
{
|
||||
if (empty($entity))
|
||||
{
|
||||
$entitystring=$langs->trans("AllEntities");
|
||||
}
|
||||
else
|
||||
{
|
||||
$mc->getInfo($entity);
|
||||
$entitystring=$mc->label;
|
||||
}
|
||||
}
|
||||
|
||||
$li=$userstatic->getNomUrl(-1, '', 0, 1);
|
||||
if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity)
|
||||
{
|
||||
$li.=img_picto($langs->trans("SuperAdministrator"), 'redstar');
|
||||
}
|
||||
elseif ($userstatic->admin)
|
||||
{
|
||||
$li.=img_picto($langs->trans("Administrator"), 'star');
|
||||
}
|
||||
$li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')';
|
||||
$li=$userstatic->getNomUrl(-1, '', 0, 1);
|
||||
if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity)
|
||||
{
|
||||
$li.=img_picto($langs->trans("SuperAdministrator"), 'redstar');
|
||||
}
|
||||
elseif ($userstatic->admin)
|
||||
{
|
||||
$li.=img_picto($langs->trans("Administrator"), 'star');
|
||||
}
|
||||
$li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')';
|
||||
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_user'],
|
||||
'statut'=>$val['statut'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td class="'.($val['statut']?'usertdenabled':'usertddisabled').'">'.$li.'</td><td align="right" class="'.($val['statut']?'usertdenabled':'usertddisabled').'">'.$userstatic->getLibStatut(3).'</td></tr></table>'
|
||||
);
|
||||
}
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_user'],
|
||||
'statut'=>$val['statut'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td class="'.($val['statut']?'usertdenabled':'usertddisabled').'">'.$li.'</td><td align="right" class="'.($val['statut']?'usertdenabled':'usertddisabled').'">'.$userstatic->getLibStatut(3).'</td></tr></table>'
|
||||
);
|
||||
}
|
||||
|
||||
//var_dump($data);
|
||||
//var_dump($data);
|
||||
|
||||
$title = $langs->trans("ListOfUsers"). ' - '.$langs->trans("HierarchicView");
|
||||
$title = $langs->trans("ListOfUsers"). ' - '.$langs->trans("HierarchicView");
|
||||
|
||||
$param="search_statut=".urlencode($search_statut);
|
||||
$param="search_statut=".urlencode($search_statut);
|
||||
|
||||
$newcardbutton='';
|
||||
if ($canadduser)
|
||||
{
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1': '').'&leftmenu=');
|
||||
}
|
||||
$newcardbutton='';
|
||||
if ($canadduser)
|
||||
{
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1': '').'&leftmenu=');
|
||||
}
|
||||
|
||||
$morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list paddingleft', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:''));
|
||||
$morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list paddingleft', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:''));
|
||||
|
||||
print load_fiche_titre($title, $morehtmlright.' '.$newcardbutton);
|
||||
print load_fiche_titre($title, $morehtmlright.' '.$newcardbutton);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print '<table class="liste nohover centpercent">';
|
||||
print '<table class="liste nohover centpercent">';
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
// Status
|
||||
print '<td class="liste_titre right">';
|
||||
print $form->selectarray('search_statut', array('-1'=>'','1'=>$langs->trans('Enabled')), $search_statut);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
// Status
|
||||
print '<td class="liste_titre right">';
|
||||
print $form->selectarray('search_statut', array('-1'=>'','1'=>$langs->trans('Enabled')), $search_statut);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("HierarchicView");
|
||||
print_liste_field_titre('<div id="iddivjstreecontrol"><a href="#">'.img_picto('', 'object_category').' '.$langs->trans("UndoExpandAll").'</a> | <a href="#">'.img_picto('', 'object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div>', $_SERVER['PHP_SELF'], "", '', "", 'align="center"');
|
||||
print_liste_field_titre("Status", $_SERVER['PHP_SELF'], "", '', "", 'align="right"');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch ');
|
||||
print '</tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("HierarchicView");
|
||||
print_liste_field_titre('<div id="iddivjstreecontrol"><a href="#">'.img_picto('', 'object_category').' '.$langs->trans("UndoExpandAll").'</a> | <a href="#">'.img_picto('', 'object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div>', $_SERVER['PHP_SELF'], "", '', "", 'align="center"');
|
||||
print_liste_field_titre("Status", $_SERVER['PHP_SELF'], "", '', "", 'align="right"');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch ');
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$nbofentries=(count($data) - 1);
|
||||
$nbofentries=(count($data) - 1);
|
||||
|
||||
if ($nbofentries > 0)
|
||||
{
|
||||
print '<tr '.$bc[false].'><td colspan="3">';
|
||||
tree_recur($data, $data[0], 0);
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[true].'>';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('', 'treemenu/branchbottom.gif').'</td>';
|
||||
print '<td valign="middle">';
|
||||
print $langs->trans("NoCategoryYet");
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</table>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($nbofentries > 0)
|
||||
{
|
||||
print '<tr '.$bc[false].'><td colspan="3">';
|
||||
tree_recur($data, $data[0], 0);
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[true].'>';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('', 'treemenu/branchbottom.gif').'</td>';
|
||||
print '<td valign="middle">';
|
||||
print $langs->trans("NoCategoryYet");
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</table>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print "</form>\n";
|
||||
print "</table>";
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@ -27,21 +27,24 @@
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
if (! empty($conf->categorie->enabled))
|
||||
if (! empty($conf->categorie->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
}
|
||||
|
||||
if (! $user->rights->user->user->lire && ! $user->admin)
|
||||
if (! $user->rights->user->user->lire && ! $user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Load translation files required by page
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array('users', 'companies', 'hrm'));
|
||||
|
||||
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'userlist'; // To manage different context of search
|
||||
|
||||
// Security check (for external users)
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0)
|
||||
if ($user->societe_id > 0) {
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
// Load mode employee
|
||||
$mode = GETPOST("mode", 'alpha');
|
||||
@ -535,29 +538,29 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
if (! empty($arrayfields['u.firstname']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->firstname.'</td>';
|
||||
print '<td>'.$obj->firstname.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.gender']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->gender) print $langs->trans("Gender".$obj->gender);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($obj->gender) print $langs->trans("Gender".$obj->gender);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.employee']['checked']))
|
||||
{
|
||||
print '<td>'.yn($obj->employee).'</td>';
|
||||
print '<td>'.yn($obj->employee).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.accountancy_code']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code.'</td>';
|
||||
print '<td>'.$obj->accountancy_code.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.email']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.api_key']['checked']))
|
||||
@ -580,7 +583,7 @@ while ($i < min($num, $limit))
|
||||
print $langs->trans("DomainUser");
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
print $langs->trans("InternalUser");
|
||||
}
|
||||
print '</td>';
|
||||
@ -673,9 +676,9 @@ while ($i < min($num, $limit))
|
||||
// Status
|
||||
if (! empty($arrayfields['u.statut']['checked']))
|
||||
{
|
||||
$userstatic->statut=$obj->statut;
|
||||
print '<td class="center">'.$userstatic->getLibStatut(3).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
$userstatic->statut=$obj->statut;
|
||||
print '<td class="center">'.$userstatic->getLibStatut(3).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Action column
|
||||
print '<td></td>';
|
||||
|
||||
@ -208,7 +208,7 @@ if ($result > 0)
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
// $listofemails=$object->thirdparty_and_contact_email_array();
|
||||
// $listofemails=$object->thirdparty_and_contact_email_array();
|
||||
if ($object->email)
|
||||
{
|
||||
$actions=array();
|
||||
@ -294,7 +294,7 @@ if ($result > 0)
|
||||
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$i = 0;
|
||||
|
||||
$userstatic=new user($db);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user