Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/opensurvey/index.php
This commit is contained in:
commit
50480bf517
@ -27,6 +27,15 @@ With
|
||||
|
||||
|
||||
|
||||
ESCPOS:
|
||||
-------
|
||||
Replace
|
||||
private $connector;
|
||||
With
|
||||
protected $connector;
|
||||
|
||||
|
||||
|
||||
NUSOAP:
|
||||
-------
|
||||
* In file nusoap.php, to avoid a warning,
|
||||
|
||||
@ -162,7 +162,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
||||
{
|
||||
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
|
||||
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
|
||||
if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature';
|
||||
if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal';
|
||||
}
|
||||
// Other checks
|
||||
if (isset($_POST["code"]))
|
||||
@ -437,7 +437,7 @@ if ($id)
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
}
|
||||
if ($fieldlist[$field]=='nature') {
|
||||
$valuetoshow=$langs->trans("Nature");
|
||||
$valuetoshow=$langs->trans("NatureOfJournal");
|
||||
}
|
||||
|
||||
if ($valuetoshow != '') {
|
||||
@ -516,7 +516,7 @@ if ($id)
|
||||
}
|
||||
|
||||
// Title line with search boxes
|
||||
print '<tr class="liste_titre_filter liste_titre_add">';
|
||||
/*print '<tr class="liste_titre_filter liste_titre_add">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
@ -524,16 +524,14 @@ if ($id)
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
if ($filterfound)
|
||||
{
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
}
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
*/
|
||||
|
||||
// Title of lines
|
||||
print '<tr class="liste_titre">';
|
||||
print '<tr class="liste_titre liste_titre_add">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
@ -558,7 +556,7 @@ if ($id)
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
}
|
||||
if ($fieldlist[$field]=='nature') {
|
||||
$valuetoshow=$langs->trans("Nature");
|
||||
$valuetoshow=$langs->trans("NatureOfJournal");
|
||||
}
|
||||
|
||||
// Affiche nom du champ
|
||||
|
||||
@ -201,6 +201,7 @@ dol_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday');
|
||||
|
||||
print load_fiche_titre($langs->trans("HolidaysNumberingModules"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100">'.$langs->trans("Name").'</td>';
|
||||
@ -294,8 +295,10 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
@ -331,6 +334,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -457,6 +461,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print "<br>";
|
||||
|
||||
|
||||
@ -469,6 +474,8 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_other">';
|
||||
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
@ -506,6 +513,8 @@ print '<input size="50" class="flat" type="text" name="HOLIDAY_DRAFT_WATERMARK"
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
|
||||
@ -495,7 +495,7 @@ if (is_array($blocks))
|
||||
print '<td'.(preg_match('/<a/', $object_link) ? ' class="nowrap"' : '').'><!-- object_link -->'.$object_link.'</td>';
|
||||
|
||||
// Amount
|
||||
print '<td class="right">'.price($block->amounts).'</td>';
|
||||
print '<td class="right nowraponall">'.price($block->amounts).'</td>';
|
||||
|
||||
// Details link
|
||||
print '<td align="center"><a href="#" data-blockid="'.$block->id.'" rel="show-info">'.img_info($langs->trans('ShowDetails')).'</a></td>';
|
||||
|
||||
@ -526,6 +526,7 @@ if ($resql)
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||
$caction=new CActionComm($db);
|
||||
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
|
||||
$contactListCache = array();
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
@ -645,7 +646,34 @@ if ($resql)
|
||||
// Contact
|
||||
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
||||
print '<td>';
|
||||
if ($obj->fk_contact > 0)
|
||||
|
||||
|
||||
$actionstatic->fetchResources();
|
||||
if(!empty($actionstatic->socpeopleassigned))
|
||||
{
|
||||
$contactList = array();
|
||||
foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned)
|
||||
{
|
||||
if(!isset($contactListCache[$socpeopleassigned['id']]))
|
||||
{
|
||||
// if no cache found we fetch it
|
||||
$contact = new Contact($db);
|
||||
if($contact->fetch($socpeopleassigned['id'])>0)
|
||||
{
|
||||
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1,'',28);
|
||||
$contactList[] = $contact->getNomUrl(1,'',28);
|
||||
}
|
||||
}
|
||||
else{
|
||||
// use cache
|
||||
$contactList[] = $contactListCache[$socpeopleassigned['id']];
|
||||
}
|
||||
}
|
||||
if(!empty($contactList)){
|
||||
print implode(', ', $contactList);
|
||||
}
|
||||
}
|
||||
elseif ($obj->fk_contact > 0) //keep for retrocompatibility with faraway event
|
||||
{
|
||||
$contactstatic->id=$obj->fk_contact;
|
||||
$contactstatic->email=$obj->email;
|
||||
|
||||
@ -1330,9 +1330,9 @@ class Propal extends CommonObject
|
||||
// Hook of thirdparty module
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('objFrom'=>$this,'clonedObj'=>$clonedObj);
|
||||
$parameters=array('objFrom'=>$this,'clonedObj'=>$object);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook=$hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1519,11 +1519,11 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
if ($element == 'order' || $element == 'commande') {
|
||||
$element = $subelement = 'commande';
|
||||
}
|
||||
if ($element == 'propal') {
|
||||
elseif ($element == 'propal') {
|
||||
$element = 'comm/propal';
|
||||
$subelement = 'propal';
|
||||
}
|
||||
if ($element == 'contract') {
|
||||
elseif ($element == 'contract') {
|
||||
$element = $subelement = 'contrat';
|
||||
}
|
||||
|
||||
|
||||
@ -62,42 +62,52 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('directdebitcard','globalcard'));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == "new")
|
||||
$parameters = array('socid' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($object->id > 0)
|
||||
if ($action == "new")
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
|
||||
if ($result > 0)
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$db->commit();
|
||||
$db->begin();
|
||||
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
$action='';
|
||||
}
|
||||
$action='';
|
||||
}
|
||||
|
||||
if ($action == "delete")
|
||||
{
|
||||
if ($object->id > 0)
|
||||
if ($action == "delete")
|
||||
{
|
||||
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
|
||||
if ($result == 0)
|
||||
if ($object->id > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
|
||||
if ($result == 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,42 +52,52 @@ $page = GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
|
||||
$hookmanager->initHooks(array('directdebitcreatecard','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Change customer bank information to withdraw
|
||||
if ($action == 'modify')
|
||||
{
|
||||
for ($i = 1 ; $i < 9 ; $i++)
|
||||
{
|
||||
dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
if ($action == 'create')
|
||||
{
|
||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
|
||||
$bprev = new BonPrelevement($db);
|
||||
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), (GETPOST('reday')+$conf->global->PRELEVEMENT_ADDDAYS), GETPOST('reyear'));
|
||||
$parameters = array('mode' => $mode, 'format' => $format, 'limit' => $limit, 'page' => $page, 'offset' => $offset);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate);
|
||||
if ($result < 0)
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Change customer bank information to withdraw
|
||||
if ($action == 'modify')
|
||||
{
|
||||
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
||||
}
|
||||
elseif ($result == 0)
|
||||
{
|
||||
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed", $format);
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$mesg.='<br>'."\n";
|
||||
foreach($bprev->invoice_in_error as $key => $val)
|
||||
for ($i = 1 ; $i < 9 ; $i++)
|
||||
{
|
||||
$mesg.='<span class="warning">'.$val."</span><br>\n";
|
||||
dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
else
|
||||
if ($action == 'create')
|
||||
{
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
|
||||
$bprev = new BonPrelevement($db);
|
||||
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), (GETPOST('reday')+$conf->global->PRELEVEMENT_ADDDAYS), GETPOST('reyear'));
|
||||
|
||||
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
||||
}
|
||||
elseif ($result == 0)
|
||||
{
|
||||
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed", $format);
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$mesg.='<br>'."\n";
|
||||
foreach($bprev->invoice_in_error as $key => $val)
|
||||
{
|
||||
$mesg.='<span class="warning">'.$val."</span><br>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org>
|
||||
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
@ -53,6 +53,7 @@ abstract class CommonObject
|
||||
|
||||
/**
|
||||
* @var string Error string
|
||||
* @see $errors
|
||||
*/
|
||||
public $error;
|
||||
|
||||
|
||||
@ -2594,7 +2594,7 @@ class Form
|
||||
}
|
||||
|
||||
$opt.= "</option>\n";
|
||||
$optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>$outprice_ht, 'price_ttc'=>$outprice_ttc, 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit);
|
||||
$optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
* $backtopage URL to come back to from discount modification pages
|
||||
*/
|
||||
|
||||
$classname = get_class($object);
|
||||
$objclassname = get_class($object);
|
||||
$isInvoice = in_array($object->element, array('facture', 'invoice', 'facture_fourn', 'invoice_supplier'));
|
||||
$isNewObject = empty($object->id) && empty($object->rowid);
|
||||
|
||||
@ -53,11 +53,11 @@ if($isNewObject) print ' ('.$addrelativediscount.')';
|
||||
// Is there is commercial discount or down payment available ?
|
||||
if ($absolute_discount > 0) {
|
||||
|
||||
if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut > $classname::STATUS_DRAFT || $object->type == $classname::TYPE_CREDIT_NOTE || $object->type == $classname::TYPE_DEPOSIT) {
|
||||
if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut > $objclassname::STATUS_DRAFT || $object->type == $objclassname::TYPE_CREDIT_NOTE || $object->type == $objclassname::TYPE_DEPOSIT) {
|
||||
$translationKey = ! empty($discount_type) ? 'HasAbsoluteDiscountFromSupplier' : 'CompanyHasAbsoluteDiscount';
|
||||
$text = $langs->trans($translationKey, price($absolute_discount), $langs->transnoentities("Currency" . $conf->currency)).'.';
|
||||
|
||||
if ($isInvoice && ! $isNewObject && $object->statut > $classname::STATUS_DRAFT && $object->type != $classname::TYPE_CREDIT_NOTE && $object->type != $classname::TYPE_DEPOSIT) {
|
||||
if ($isInvoice && ! $isNewObject && $object->statut > $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) {
|
||||
$text = $form->textwithpicto($text, $langs->trans('AbsoluteDiscountUse'));
|
||||
}
|
||||
|
||||
@ -77,11 +77,11 @@ if ($absolute_discount > 0) {
|
||||
if ($absolute_creditnote > 0) {
|
||||
|
||||
// If validated, we show link "add credit note to payment"
|
||||
if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut != $classname::STATUS_VALIDATED || $object->type == $classname::TYPE_CREDIT_NOTE) {
|
||||
if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) {
|
||||
$translationKey = ! empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote';
|
||||
$text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency)) . '.';
|
||||
|
||||
if ($isInvoice && ! $isNewObject && $object->statut == $classname::STATUS_DRAFT && $object->type != $classname::TYPE_DEPOSIT) {
|
||||
if ($isInvoice && ! $isNewObject && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_DEPOSIT) {
|
||||
$text = $form->textwithpicto($text, $langs->trans('CreditNoteDepositUse'));
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ if($absolute_discount <= 0 && $absolute_creditnote <= 0) {
|
||||
$translationKey = ! empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount';
|
||||
print '<br>'.$langs->trans($translationKey).'.';
|
||||
|
||||
if ($isInvoice && $object->statut == $classname::STATUS_DRAFT && $object->type != $classname::TYPE_CREDIT_NOTE && $object->type != $classname::TYPE_DEPOSIT) {
|
||||
if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) {
|
||||
print ' (' . $addabsolutediscount . ')';
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,7 +467,8 @@ if (empty($reshook))
|
||||
|
||||
elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer)
|
||||
{
|
||||
$result = $object->delete();
|
||||
$also_update_stock = (GETPOST('alsoUpdateStock', 'alpha') ? 1 : 0);
|
||||
$result = $object->delete(0, $also_update_stock);
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
|
||||
@ -1642,7 +1643,26 @@ elseif ($id || $ref)
|
||||
// Confirm deleteion
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteSending'), $langs->trans("ConfirmDeleteSending", $object->ref), 'confirm_delete', '', 0, 1);
|
||||
$formquestion = array();
|
||||
if ($object->statut == Expedition::STATUS_CLOSED && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
$formquestion = array(
|
||||
array(
|
||||
'label' => $langs->trans('ShipmentIncrementStockOnDelete'),
|
||||
'name' => 'alsoUpdateStock',
|
||||
'type' => 'checkbox',
|
||||
'value' => 0
|
||||
),
|
||||
);
|
||||
}
|
||||
$formconfirm=$form->formconfirm(
|
||||
$_SERVER['PHP_SELF'].'?id='.$object->id,
|
||||
$langs->trans('DeleteSending'),
|
||||
$langs->trans("ConfirmDeleteSending", $object->ref),
|
||||
'confirm_delete',
|
||||
$formquestion,
|
||||
0,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
// Confirmation validation
|
||||
|
||||
@ -1149,10 +1149,11 @@ class Expedition extends CommonObject
|
||||
* Delete shipment.
|
||||
* Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element)
|
||||
*
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
|
||||
* @param int $notrigger Disable triggers
|
||||
* @param bool $also_update_stock true if the stock should be increased back (false by default)
|
||||
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
|
||||
*/
|
||||
public function delete($notrigger = 0)
|
||||
public function delete($notrigger = 0, $also_update_stock = false)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
@ -1184,7 +1185,9 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
// Stock control
|
||||
if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT)
|
||||
if (! $error && $conf->stock->enabled &&
|
||||
(($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) ||
|
||||
($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == self::STATUS_CLOSED && $also_update_stock)))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
|
||||
|
||||
|
||||
@ -1538,7 +1538,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$desc=trim($desc);
|
||||
|
||||
// Check parameters
|
||||
if ($qty < 1 && ! $fk_product)
|
||||
if ($qty < 0 && ! $fk_product)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product"));
|
||||
return -1;
|
||||
|
||||
@ -430,8 +430,8 @@ class ProductFournisseur extends Product
|
||||
$sql .= " " . $newnpr . ",";
|
||||
$sql .= $conf->entity . ",";
|
||||
$sql .= $delivery_time_days . ",";
|
||||
$sql .= (empty($supplier_reputation) ? 'NULL' : "'" . $this->db->escape($supplier_reputation) . "'");
|
||||
$sql .= (empty($barcode) ? 'NULL' : "'" . $this->db->escape($barcode) . "'");
|
||||
$sql .= (empty($supplier_reputation) ? 'NULL' : "'" . $this->db->escape($supplier_reputation) . "'") . ",";
|
||||
$sql .= (empty($barcode) ? 'NULL' : "'" . $this->db->escape($barcode) . "'") . ",";
|
||||
$sql .= (empty($fk_barcode_type) ? 'NULL' : "'" . $this->db->escape($fk_barcode_type) . "'");
|
||||
$sql .= ")";
|
||||
|
||||
@ -462,7 +462,8 @@ class ProductFournisseur extends Product
|
||||
|
||||
if (empty($error)) {
|
||||
$this->db->commit();
|
||||
return $idinserted;
|
||||
$this->product_fourn_price_id = $idinserted;
|
||||
return $this->product_fourn_price_id;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
|
||||
@ -494,11 +494,35 @@ if ($id > 0 || ! empty($ref)) {
|
||||
|
||||
$sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,";
|
||||
$sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse";
|
||||
|
||||
// Enable hooks to alter the SQL query (SELECT)
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks(
|
||||
'printFieldListSelect',
|
||||
$parameters,
|
||||
$object,
|
||||
$action
|
||||
);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON l.fk_product=p.rowid";
|
||||
$sql .= " WHERE l.fk_commande = " . $object->id;
|
||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
$sql .= " AND l.product_type = 0";
|
||||
|
||||
// Enable hooks to alter the SQL query (WHERE)
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks(
|
||||
'printFieldListWhere',
|
||||
$parameters,
|
||||
$object,
|
||||
$action
|
||||
);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent, p.fk_default_warehouse"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product
|
||||
$sql .= " ORDER BY p.ref, p.label";
|
||||
|
||||
@ -528,7 +552,19 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '<td class="right">' . $langs->trans("QtyDispatchedShort") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyToDispatchShort") . '</td>';
|
||||
print '<td width="32"></td>';
|
||||
print '<td class="right">' . $langs->trans("Warehouse") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("Warehouse") . '</td>';
|
||||
|
||||
// Enable hooks to append additional columns
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks(
|
||||
'printFieldListTitle',
|
||||
$parameters,
|
||||
$object,
|
||||
$action
|
||||
);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -611,6 +647,23 @@ if ($id > 0 || ! empty($ref)) {
|
||||
//print img_picto($langs->trans('AddDispatchBatchLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
|
||||
print '</td>'; // Dispatch column
|
||||
print '<td></td>'; // Warehouse column
|
||||
|
||||
// Enable hooks to append additional columns
|
||||
$parameters = array(
|
||||
'is_information_row' => true, // allows hook to distinguish between the
|
||||
// rows with information and the rows with
|
||||
// dispatch form input
|
||||
'objp' => $objp
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks(
|
||||
'printFieldListValue',
|
||||
$parameters,
|
||||
$object,
|
||||
$action
|
||||
);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven" name="' . $type . $suffix . '">';
|
||||
@ -651,6 +704,23 @@ if ($id > 0 || ! empty($ref)) {
|
||||
//print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
|
||||
print '</td>'; // Dispatch column
|
||||
print '<td></td>'; // Warehouse column
|
||||
|
||||
// Enable hooks to append additional columns
|
||||
$parameters = array(
|
||||
'is_information_row' => true, // allows hook to distinguish between the
|
||||
// rows with information and the rows with
|
||||
// dispatch form input
|
||||
'objp' => $objp
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks(
|
||||
'printFieldListValue',
|
||||
$parameters,
|
||||
$object,
|
||||
$action
|
||||
);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven" name="' . $type . $suffix . '">';
|
||||
@ -702,6 +772,19 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Enable hooks to append additional columns
|
||||
$parameters = array(
|
||||
'is_information_row' => false // this is a dispatch form row
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks(
|
||||
'printFieldListValue',
|
||||
$parameters,
|
||||
$object,
|
||||
$action
|
||||
);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,6 +75,7 @@ if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
$parameters=array();
|
||||
|
||||
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
@ -129,6 +130,11 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity,";
|
||||
$sql.= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,";
|
||||
$sql.= " s.rowid as socid, s.nom as name";
|
||||
// Add fields to SELECT from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if ($catid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as ppf ON p.rowid = ppf.fk_product";
|
||||
@ -159,6 +165,12 @@ if ($fourn_id > 0)
|
||||
$sql .= " AND ppf.fk_soc = ".$fourn_id;
|
||||
}
|
||||
|
||||
// Add WHERE filters from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records without orderby and limit
|
||||
@ -243,6 +255,11 @@ if ($resql)
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
// add filters from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
print $hookmanager->resPrint;
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
@ -258,6 +275,11 @@ if ($resql)
|
||||
print_liste_field_titre("BuyingPrice", $_SERVER["PHP_SELF"], "ppf.price", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "ppf.quantity", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("UnitPrice", $_SERVER["PHP_SELF"], "ppf.unitprice", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
// add header cells from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
print $hookmanager->resPrint;
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"]);
|
||||
print "</tr>\n";
|
||||
|
||||
@ -293,6 +315,12 @@ if ($resql)
|
||||
|
||||
print '<td class="right">'.(isset($objp->unitprice) ? price($objp->unitprice) : '').'</td>';
|
||||
|
||||
// add additional columns from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '<td class="right"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -144,9 +144,11 @@ class Escpos {
|
||||
|
||||
/**
|
||||
* @var PrintConnector
|
||||
* @CHANGE
|
||||
*/
|
||||
private $connector;
|
||||
|
||||
protected $connector;
|
||||
// private $connector;
|
||||
|
||||
/**
|
||||
* @var AbstractCapabilityProfile
|
||||
*/
|
||||
|
||||
@ -265,7 +265,7 @@ AccountingJournals=Accounting journals
|
||||
AccountingJournal=Accounting journal
|
||||
NewAccountingJournal=New accounting journal
|
||||
ShowAccoutingJournal=Show accounting journal
|
||||
Nature=Nature
|
||||
NatureOfJournal=Nature of Journal
|
||||
AccountingJournalType1=Miscellaneous operations
|
||||
AccountingJournalType2=Sales
|
||||
AccountingJournalType3=Purchases
|
||||
|
||||
@ -60,6 +60,8 @@ NoProductToShipFoundIntoStock=Aucun produit à expédier n'a été trouver dans
|
||||
WeightVolShort=Poids/vol.
|
||||
ValidateOrderFirstBeforeShipment=Vous devez d'abord valider la commande pour pouvoir créer une expédition.
|
||||
|
||||
ShipmentIncrementStockOnDelete=Remettre en stock les éléments de cette expédition
|
||||
|
||||
# Sending methods
|
||||
# ModelDocument
|
||||
DocumentModelTyphon=Modèle de bon de réception/livraison complet (logo…)
|
||||
|
||||
@ -26,26 +26,28 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("opensurvey");
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->opensurvey->read) accessforbidden();
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
$hookmanager = new HookManager($db);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('opensurveyindex'));
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("opensurvey");
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$nbsondages=0;
|
||||
$sql='SELECT COUNT(*) as nb FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
|
||||
$sql = 'SELECT COUNT(*) as nb';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
|
||||
$sql.= ' WHERE entity IN ('.getEntity('survey').')';
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -54,27 +56,16 @@ if ($resql)
|
||||
}
|
||||
else dol_print_error($db, '');
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
print load_fiche_titre($langs->trans("OpenSurveyArea"));
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
$nbsondages=0;
|
||||
$sql='SELECT COUNT(*) as nb FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
$nbsondages=$obj->nb;
|
||||
}
|
||||
else dol_print_error($db, '');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("OpenSurveyArea").'</td></tr>';
|
||||
print "<tr ".$bc[0].">";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("NbOfSurveys").'</td><td class="right"><a href="list.php">'.$nbsondages.'</a></td>';
|
||||
print "</tr>";
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
|
||||
@ -82,8 +73,7 @@ print "</tr>";
|
||||
//print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
print '</div></div>';
|
||||
|
||||
$parameters = array('user' => $user);
|
||||
$reshook = $hookmanager->executeHooks('dashboardOpenSurvey', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@ -1711,20 +1711,18 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Update all child soc
|
||||
print '<tr><td width="15%">';
|
||||
print $langs->trans('ForceUpdateChildPriceSoc');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="checkbox" name="updatechildprice" value="1">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
|
||||
// Update all child soc
|
||||
print '<div class="marginbottomonly">';
|
||||
print '<input type="checkbox" name="updatechildprice" value="1"> ';
|
||||
print $langs->trans('ForceUpdateChildPriceSoc');
|
||||
print '</div>';
|
||||
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
@ -1804,10 +1802,8 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
|
||||
// Update all child soc
|
||||
print '<tr><td>';
|
||||
print $langs->trans('ForceUpdateChildPriceSoc');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="checkbox" name="updatechildprice" value="1">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -1816,6 +1812,11 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<div class="marginbottomonly">';
|
||||
print '<input type="checkbox" name="updatechildprice" value="1"> ';
|
||||
print $langs->trans('ForceUpdateChildPriceSoc');
|
||||
print "</div>";
|
||||
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
@ -2162,7 +2163,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
// Action
|
||||
if ($user->rights->produit->supprimer || $user->rights->service->supprimer)
|
||||
{
|
||||
print '<td class="right">';
|
||||
print '<td class="right nowraponall">';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=showlog_customer_price&id=' . $object->id . '&socid=' . $line->fk_soc . '">';
|
||||
print img_info($langs->trans('PriceByCustomerLog'));
|
||||
print '</a>';
|
||||
|
||||
@ -440,7 +440,7 @@ class Project extends CommonObject
|
||||
|
||||
$sql = "SELECT rowid, ref, title, description, public, datec, opp_amount, budget_amount,";
|
||||
$sql.= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut, fk_opp_status, opp_percent,";
|
||||
$sql.= " note_private, note_public, model_pdf, bill_time";
|
||||
$sql.= " note_private, note_public, model_pdf, bill_time, entity";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "projet";
|
||||
if (! empty($id))
|
||||
{
|
||||
@ -488,6 +488,7 @@ class Project extends CommonObject
|
||||
$this->budget_amount = $obj->budget_amount;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->bill_time = (int) $obj->bill_time;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load(array("companies", "bills", "propal", "orders"));
|
||||
$langs->loadLangs(array("companies", "bills", "propal", "orders"));
|
||||
|
||||
if (GETPOST('actioncode', 'array'))
|
||||
{
|
||||
|
||||
@ -958,12 +958,13 @@ else
|
||||
if (empty($duplicate_code_error)) {
|
||||
$object->code_client = GETPOST('customer_code', 'alpha');
|
||||
$object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur;
|
||||
$object->code_fournisseur = GETPOST('supplier_code', 'alpha');
|
||||
}
|
||||
else {
|
||||
setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'), '', 'warnings');
|
||||
}
|
||||
|
||||
$object->code_fournisseur = GETPOST('supplier_code', 'alpha');
|
||||
|
||||
$object->address = GETPOST('address', 'alpha');
|
||||
$object->zip = GETPOST('zipcode', 'alpha');
|
||||
$object->town = GETPOST('town', 'alpha');
|
||||
|
||||
@ -135,6 +135,7 @@ if (!$user->rights->societe->client->voir && !$socid) {
|
||||
}
|
||||
$sql .= ' WHERE t.entity IN (' . getEntity('ticket') . ')';
|
||||
$sql .= dolSqlDateFilter('datec', 0, 0, $endyear);
|
||||
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = " . $user->id;
|
||||
}
|
||||
@ -279,7 +280,7 @@ if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
|
||||
}
|
||||
|
||||
$sql .= ' WHERE t.entity IN (' . getEntity('ticket', 1) . ')';
|
||||
$sql .= ' WHERE t.entity IN (' . getEntity('ticket') . ')';
|
||||
$sql .= " AND t.fk_statut=0";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = " . $user->id;
|
||||
|
||||
@ -209,10 +209,7 @@ $sql=preg_replace('/, $/', '', $sql);
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)";
|
||||
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity($object->element).")";
|
||||
else $sql.=" WHERE 1 = 1";
|
||||
|
||||
|
||||
$sql.= " WHERE t.entity IN (".getEntity($object->element).")";
|
||||
foreach($search as $key => $val)
|
||||
{
|
||||
if ($key == 'fk_statut')
|
||||
|
||||
@ -81,8 +81,12 @@ $fieldstosearchall = array(
|
||||
'u.firstname'=>"Firstname",
|
||||
'u.accountancy_code'=>"AccountancyCode",
|
||||
'u.email'=>"EMail",
|
||||
'u.note'=>"Note"
|
||||
'u.note'=>"Note",
|
||||
);
|
||||
if (! empty($conf->api->enabled))
|
||||
{
|
||||
$fieldstosearchall['u.api_key']="ApiKey";
|
||||
}
|
||||
|
||||
// Definition of fields for list
|
||||
$arrayfields=array(
|
||||
@ -93,6 +97,7 @@ $arrayfields=array(
|
||||
'u.employee'=>array('label'=>$langs->trans("Employee"), 'checked'=>($mode=='employee'?1:0)),
|
||||
'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0),
|
||||
'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1),
|
||||
'u.api_key'=>array('label'=>$langs->trans("ApiKey"), 'checked'=>0, "enabled"=>($conf->api->enabled && $user->admin)),
|
||||
'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
|
||||
'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))),
|
||||
'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1),
|
||||
@ -121,10 +126,10 @@ $search_gender=GETPOST('search_gender', 'alpha');
|
||||
$search_employee=GETPOST('search_employee', 'alpha');
|
||||
$search_accountancy_code=GETPOST('search_accountancy_code', 'alpha');
|
||||
$search_email=GETPOST('search_email', 'alpha');
|
||||
$search_api_key=GETPOST('search_api_key', 'alphanohtml');
|
||||
$search_statut=GETPOST('search_statut', 'intcomma');
|
||||
$search_thirdparty=GETPOST('search_thirdparty', 'alpha');
|
||||
$search_supervisor=GETPOST('search_supervisor', 'intcomma');
|
||||
$search_previousconn=GETPOST('search_previousconn', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$search_categ = GETPOST("search_categ", 'int');
|
||||
$catid = GETPOST('catid', 'int');
|
||||
@ -165,6 +170,7 @@ if (empty($reshook))
|
||||
$search_statut="";
|
||||
$search_thirdparty="";
|
||||
$search_supervisor="";
|
||||
$search_api_key="";
|
||||
$search_datelastlogin="";
|
||||
$search_datepreviouslogin="";
|
||||
$search_date_creation="";
|
||||
@ -185,7 +191,7 @@ $user2=new User($db);
|
||||
|
||||
$buttonviewhierarchy='<form action="'.DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : '').'" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("HierarchicView")).'"></form>';
|
||||
|
||||
$sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.accountancy_code, u.gender, u.employee, u.photo,";
|
||||
$sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.api_key, u.accountancy_code, u.gender, u.employee, u.photo,";
|
||||
$sql.= " u.datelastlogin, u.datepreviouslogin,";
|
||||
$sql.= " u.ldap_sid, u.statut, u.entity,";
|
||||
$sql.= " u.tms as date_update, u.datec as date_creation,";
|
||||
@ -223,6 +229,7 @@ if (is_numeric($search_employee) && $search_employee >= 0) {
|
||||
}
|
||||
if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code);
|
||||
if ($search_email != '') $sql.= natural_search("u.email", $search_email);
|
||||
if ($search_api_key != '') $sql.= natural_search("u.api_key", $search_api_key);
|
||||
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND u.statut IN (".$db->escape($search_statut).")";
|
||||
if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
|
||||
if ($catid > 0) $sql.= " AND cu.fk_categorie = ".$catid;
|
||||
@ -277,6 +284,7 @@ if ($search_gender != '') $param.="&search_gender=".urlencode($search_gender
|
||||
if ($search_employee != '') $param.="&search_employee=".urlencode($search_employee);
|
||||
if ($search_accountancy_code != '') $param.="&search_accountancy_code=".urlencode($search_accountancy_code);
|
||||
if ($search_email != '') $param.="&search_email=".urlencode($search_email);
|
||||
if ($search_api_key != '') $param.="&search_api_key=".urlencode($search_api_key);
|
||||
if ($search_supervisor > 0) $param.="&search_supervisor=".urlencode($search_supervisor);
|
||||
if ($search_statut != '') $param.="&search_statut=".urlencode($search_statut);
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
@ -359,15 +367,15 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"")
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (! empty($arrayfields['u.login']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_login" size="6" value="'.$search_login.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['u.lastname']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_lastname" size="6" value="'.$search_lastname.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_lastname" class="maxwidth50" value="'.$search_lastname.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['u.firstname']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_firstname" size="6" value="'.$search_firstname.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_firstname" class="maxwidth50" value="'.$search_firstname.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['u.gender']['checked']))
|
||||
{
|
||||
@ -384,15 +392,19 @@ if (! empty($arrayfields['u.employee']['checked']))
|
||||
}
|
||||
if (! empty($arrayfields['u.accountancy_code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_accountancy_code" size="4" value="'.$search_accountancy_code.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_accountancy_code" class="maxwidth50" value="'.$search_accountancy_code.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['u.email']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_email" size="6" value="'.$search_email.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_email" class="maxwidth75" value="'.$search_email.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['u.api_key']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_api_key" class="maxwidth50" value="'.$search_api_key.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['u.fk_soc']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre"><input type="text" name="search_thirdparty" size="6" value="'.$search_thirdparty.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_thirdparty" class="maxwidth75" value="'.$search_thirdparty.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['u.entity']['checked']))
|
||||
{
|
||||
@ -455,6 +467,7 @@ if (! empty($arrayfields['u.gender']['checked'])) print_liste_field_titr
|
||||
if (! empty($arrayfields['u.employee']['checked'])) print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.employee", $param, "", "", $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre("AccountancyCode", $_SERVER['PHP_SELF'], "u.accountancy_code", $param, "", "", $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['u.email']['checked'])) print_liste_field_titre("EMail", $_SERVER['PHP_SELF'], "u.email", $param, "", "", $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['u.api_key']['checked'])) print_liste_field_titre("ApiKey", $_SERVER['PHP_SELF'], "u.api_key", $param, "", "", $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "u.fk_soc", $param, "", "", $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre("Entity", $_SERVER['PHP_SELF'], "u.entity", $param, "", "", $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder);
|
||||
@ -542,6 +555,11 @@ while ($i < min($num, $limit))
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.api_key']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->api_key.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.fk_soc']['checked']))
|
||||
{
|
||||
print "<td>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user