Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
9dad8f0fb7
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -19,19 +19,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/workflow.php
|
* \file htdocs/admin/workflow.php
|
||||||
* \ingroup company
|
* \ingroup company
|
||||||
* \brief Workflows setup page
|
* \brief Workflows setup page
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// security check
|
||||||
$langs->loadLangs(array("admin", "workflow", "propal", "workflow", "orders", "supplier_proposal", "receptions"));
|
|
||||||
|
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) accessforbidden();
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("admin", "workflow", "propal", "workflow", "orders", "supplier_proposal", "receptions", "errors"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
@ -39,157 +40,199 @@ $action = GETPOST('action', 'alpha');
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (preg_match('/set(.*)/', $action, $reg))
|
if (preg_match('/set(.*)/', $action, $reg)) {
|
||||||
{
|
if (!dolibarr_set_const($db, $reg[1], '1', 'chaine', 0, '', $conf->entity) > 0) {
|
||||||
if (!dolibarr_set_const($db, $reg[1], '1', 'chaine', 0, '', $conf->entity) > 0)
|
dol_print_error($db);
|
||||||
{
|
}
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/del(.*)/', $action, $reg))
|
if (preg_match('/del(.*)/', $action, $reg)) {
|
||||||
{
|
if (!dolibarr_set_const($db, $reg[1], '0', 'chaine', 0, '', $conf->entity) > 0) {
|
||||||
if (!dolibarr_set_const($db, $reg[1], '0', 'chaine', 0, '', $conf->entity) > 0)
|
dol_print_error($db);
|
||||||
{
|
}
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of workflow we can enable
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
$workflowcodes = array(
|
||||||
|
// Automatic creation
|
||||||
|
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
|
||||||
|
'family'=>'create',
|
||||||
|
'position'=>10,
|
||||||
|
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
|
||||||
|
'picto'=>'order'
|
||||||
|
),
|
||||||
|
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
|
||||||
|
'family'=>'create',
|
||||||
|
'position'=>20,
|
||||||
|
'enabled'=>(!empty($conf->commande->enabled) && !empty($conf->facture->enabled)),
|
||||||
|
'picto'=>'bill'
|
||||||
|
),
|
||||||
|
|
||||||
|
'separator1'=>array('family'=>'separator', 'position'=>25),
|
||||||
|
|
||||||
|
// Automatic classification of proposal
|
||||||
|
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
|
||||||
|
'family'=>'classify_proposal',
|
||||||
|
'position'=>30,
|
||||||
|
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
|
||||||
|
'picto'=>'propal',
|
||||||
|
'warning'=>''
|
||||||
|
),
|
||||||
|
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
|
||||||
|
'family'=>'classify_proposal',
|
||||||
|
'position'=>31,
|
||||||
|
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->facture->enabled)),
|
||||||
|
'picto'=>'propal',
|
||||||
|
'warning'=>''
|
||||||
|
),
|
||||||
|
|
||||||
|
// Automatic classification of order
|
||||||
|
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array(
|
||||||
|
'family'=>'classify_order',
|
||||||
|
'position'=>40,
|
||||||
|
'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)),
|
||||||
|
'picto'=>'order'
|
||||||
|
),
|
||||||
|
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
|
||||||
|
'family'=>'classify_order',
|
||||||
|
'position'=>41,
|
||||||
|
'enabled'=>(!empty($conf->facture->enabled) && !empty($conf->commande->enabled)),
|
||||||
|
'picto'=>'order',
|
||||||
|
'warning'=>''
|
||||||
|
), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
|
||||||
|
|
||||||
|
'separator2'=>array('family'=>'separator', 'position'=>50),
|
||||||
|
|
||||||
|
// Automatic classification supplier proposal
|
||||||
|
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
|
||||||
|
'family'=>'classify_supplier_proposal',
|
||||||
|
'position'=>60,
|
||||||
|
'enabled'=>(!empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||||
|
'picto'=>'propal',
|
||||||
|
'warning'=>''
|
||||||
|
),
|
||||||
|
|
||||||
|
// Automatic classification supplier order
|
||||||
|
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
|
||||||
|
'family'=>'classify_supplier_order',
|
||||||
|
'position'=>62,
|
||||||
|
'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||||
|
'picto'=>'order',
|
||||||
|
'warning'=>''
|
||||||
|
),
|
||||||
|
|
||||||
|
// Automatic classification reception
|
||||||
|
'WORKFLOW_BILL_ON_RECEPTION'=>array(
|
||||||
|
'family'=>'classify_reception',
|
||||||
|
'position'=>64,
|
||||||
|
'enabled'=>(!empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||||
|
'picto'=>'bill'
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow'])) {
|
||||||
|
foreach ($conf->modules_parts['workflow'] as $workflow) {
|
||||||
|
$workflowcodes = array_merge($workflowcodes, $workflow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove not available workflows (based on activated modules and global defined keys)
|
||||||
|
$workflowcodes = array_filter($workflowcodes, function ($var) {
|
||||||
|
return $var['enabled']; });
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('', $langs->trans("WorkflowSetup"), '');
|
llxHeader('', $langs->trans("WorkflowSetup"), "EN:Module_Workflow_En|FR:Module_Workflow|ES:Módulo_Workflow");
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("WorkflowSetup"), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans("WorkflowSetup"), $linkback, 'title_setup');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("WorkflowDesc").'</span><br>';
|
print '<span class="opacitymedium">'.$langs->trans("WorkflowDesc").'</span>';
|
||||||
print "<br>";
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
// List of workflow we can enable
|
// current module setup don't support any automatic workflow of this module
|
||||||
|
if (count($workflowcodes) < 1) {
|
||||||
|
print $langs->trans("ThereIsNoWorkflowToModify");
|
||||||
|
|
||||||
clearstatcache();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
$workflowcodes = array(
|
return;
|
||||||
// Automatic creation
|
|
||||||
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('family'=>'create', 'position'=>10, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'),
|
|
||||||
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('family'=>'create', 'position'=>20, 'enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'),
|
|
||||||
'separator1'=>array('family'=>'separator', 'position'=>25),
|
|
||||||
// Automatic classification of proposal
|
|
||||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify_proposal', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'propal', 'warning'=>''),
|
|
||||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify_proposal', 'position'=>31, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'propal', 'warning'=>''),
|
|
||||||
'separator2'=>array('family'=>'separator', 'position'=>35),
|
|
||||||
// Automatic classification of order
|
|
||||||
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array('family'=>'classify_order', 'position'=>40, 'enabled'=>'! empty($conf->expedition->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'),
|
|
||||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify_order', 'position'=>41, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order', 'warning'=>''), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
|
|
||||||
'separator3'=>array('family'=>'separator', 'position'=>50),
|
|
||||||
// Automatic classification supplier proposal
|
|
||||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'propal', 'warning'=>''),
|
|
||||||
'separator4'=>array('family'=>'separator', 'position'=>61),
|
|
||||||
// Automatic classification supplier order
|
|
||||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)', 'picto'=>'order', 'warning'=>''),
|
|
||||||
'separator5'=>array('family'=>'separator', 'position'=>63),
|
|
||||||
// Automatic classification reception
|
|
||||||
'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'bill'),
|
|
||||||
'separator6'=>array('family'=>'separator', 'position'=>90),
|
|
||||||
// Automatic classification of intervention
|
|
||||||
'WORKFLOW_TICKET_CLOSE_INTERVENTION'=>array('family'=>'classify_intervention', 'position'=>100, 'enabled'=>'! empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled)', 'picto'=>'intervention'),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))
|
|
||||||
{
|
|
||||||
foreach ($conf->modules_parts['workflow'] as $workflow)
|
|
||||||
{
|
|
||||||
$workflowcodes = array_merge($workflowcodes, $workflow);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort on position
|
// Sort on position
|
||||||
$workflowcodes = dol_sort_array($workflowcodes, 'position');
|
$workflowcodes = dol_sort_array($workflowcodes, 'position');
|
||||||
|
|
||||||
$nbqualified = 0;
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
$oldfamily = '';
|
$oldfamily = '';
|
||||||
|
|
||||||
print '<table class="noborder centpercent">'."\n";
|
foreach ($workflowcodes as $key => $params) {
|
||||||
|
if ($params['family'] == 'separator') {
|
||||||
foreach ($workflowcodes as $key => $params)
|
print '</table>';
|
||||||
{
|
print '<br>';
|
||||||
$picto = $params['picto'];
|
print '<table class="noborder centpercent">';
|
||||||
$enabled = $params['enabled'];
|
|
||||||
$family = $params['family'];
|
|
||||||
|
|
||||||
if ($family == 'separator')
|
|
||||||
{
|
|
||||||
print '</table><br>';
|
|
||||||
print '<table class="noborder centpercent">'."\n";
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifCond($enabled)) continue;
|
if ($oldfamily != $params['family']) {
|
||||||
|
if ($params['family'] == 'create') {
|
||||||
$nbqualified++;
|
$header = $langs->trans("AutomaticCreation");
|
||||||
|
} elseif (preg_match('/classify_(.*)/', $params['family'], $reg)) {
|
||||||
|
$header = $langs->trans("AutomaticClassification");
|
||||||
if ($oldfamily != $family)
|
if ($reg[1] == 'proposal') $header .= ' - '.$langs->trans('Proposal');
|
||||||
{
|
if ($reg[1] == 'order') $header .= ' - '.$langs->trans('Order');
|
||||||
print '<tr class="liste_titre">'."\n";
|
if ($reg[1] == 'supplier_proposal') $header .= ' - '.$langs->trans('SupplierProposal');
|
||||||
print ' <td>';
|
if ($reg[1] == 'supplier_order') $header .= ' - '.$langs->trans('SupplierOrder');
|
||||||
$reg = array();
|
if ($reg[1] == 'reception') $header .= ' - '.$langs->trans('Reception');
|
||||||
if ($family == 'create') {
|
|
||||||
print $langs->trans("AutomaticCreation");
|
|
||||||
} elseif (preg_match('/classify_(.*)/', $family, $reg))
|
|
||||||
{
|
|
||||||
print $langs->trans("AutomaticClassification");
|
|
||||||
if ($reg[1] == 'proposal') print ' - '.$langs->trans('Proposal');
|
|
||||||
if ($reg[1] == 'order') print ' - '.$langs->trans('Order');
|
|
||||||
if ($reg[1] == 'supplier_proposal') print ' - '.$langs->trans('SupplierProposal');
|
|
||||||
if ($reg[1] == 'supplier_order') print ' - '.$langs->trans('SupplierOrder');
|
|
||||||
if ($reg[1] == 'reception') print ' - '.$langs->trans('Reception');
|
|
||||||
if ($reg[1] == 'intervention') print ' - '.$langs->trans('Intervention');
|
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("Description");
|
$header = $langs->trans("Description");
|
||||||
}
|
}
|
||||||
print '</td>';
|
|
||||||
print ' <td class="center" width="90px">'.$langs->trans("Status").'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
$oldfamily = $family;
|
|
||||||
}
|
|
||||||
|
|
||||||
print "<tr class=\"oddeven\">\n";
|
print '<tr class="liste_titre">';
|
||||||
print "<td>".img_object('', $picto, 'class="paddingright"').$langs->trans('desc'.$key);
|
print '<th>'.$header.'</th>';
|
||||||
if (!empty($params['warning']))
|
print '<th align="center">'.$langs->trans("Status").'</th>';
|
||||||
{
|
print '</tr>';
|
||||||
$langs->load("errors");
|
|
||||||
print ' '.img_warning($langs->transnoentitiesnoconv($params['warning']));
|
$oldfamily = $params['family'];
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
|
||||||
print '<td class="center">';
|
print '<tr class="oddeven">';
|
||||||
if (!empty($conf->use_javascript_ajax))
|
print '<td>';
|
||||||
{
|
print img_object('', $params['picto']);
|
||||||
print ajax_constantonoff($key);
|
print ' '.$langs->trans('desc'.$key);
|
||||||
} else {
|
|
||||||
if (!empty($conf->global->$key))
|
if (!empty($params['warning'])) {
|
||||||
{
|
print ' '.img_warning($langs->transnoentitiesnoconv($params['warning']));
|
||||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=del'.$key.'">';
|
}
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a>';
|
print '</td>';
|
||||||
} else {
|
|
||||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=set'.$key.'">';
|
print '<td class="center">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
print '</a>';
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
}
|
print ajax_constantonoff($key);
|
||||||
}
|
} else {
|
||||||
print '</td>';
|
if (!empty($conf->global->$key)) {
|
||||||
print '</tr>';
|
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=del'.$key.'">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
} else {
|
||||||
|
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=set'.$key.'">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($nbqualified == 0)
|
|
||||||
{
|
|
||||||
print '<tr><td colspan="3">'.$langs->trans("ThereIsNoWorkflowToModify");
|
|
||||||
}
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -1413,7 +1413,7 @@ class Setup extends DolibarrApi
|
|||||||
* @url GET conf/{constantname}
|
* @url GET conf/{constantname}
|
||||||
*
|
*
|
||||||
* @throws RestException 403 Forbidden
|
* @throws RestException 403 Forbidden
|
||||||
* @throws RestException 500 Error Bad or unknown value for constantname
|
* @throws RestException 404 Error Bad or unknown value for constantname
|
||||||
*/
|
*/
|
||||||
public function getConf($constantname)
|
public function getConf($constantname)
|
||||||
{
|
{
|
||||||
@ -1425,7 +1425,7 @@ class Setup extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) {
|
if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) {
|
||||||
throw new RestException(500, 'Error Bad or unknown value for constantname');
|
throw new RestException(404, 'Error Bad or unknown value for constantname');
|
||||||
}
|
}
|
||||||
if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $constantname)) {
|
if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $constantname)) {
|
||||||
throw new RestException(403, 'Forbidden');
|
throw new RestException(403, 'Forbidden');
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -95,6 +95,37 @@ class PaymentVarious extends CommonObject
|
|||||||
public $fk_user_modif;
|
public $fk_user_modif;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||||
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||||
|
* 'label' the translation key.
|
||||||
|
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||||
|
* 'position' is the sort order of field.
|
||||||
|
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||||
|
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||||
|
* 'noteditable' says if field is not editable (1 or 0)
|
||||||
|
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||||
|
* 'index' if we want an index in database.
|
||||||
|
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||||
|
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||||
|
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||||
|
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
||||||
|
* 'help' is a string visible as a tooltip on field
|
||||||
|
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||||
|
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||||
|
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||||
|
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||||
|
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||||
|
*
|
||||||
|
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// BEGIN MODULEBUILDER PROPERTIES
|
||||||
|
public $fields = array(
|
||||||
|
// TODO: fill this array
|
||||||
|
);
|
||||||
|
// END MODULEBUILDER PROPERTIES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
|||||||
@ -101,6 +101,37 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$typeid = '';
|
$typeid = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$search_all = GETPOSTISSET("search_all") ? trim(GETPOSTISSET("search_all", 'alpha')) : trim(GETPOST('sall'));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: fill array "$fields" in "/compta/bank/class/paymentvarious.class.php" and use
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* $object = new PaymentVarious($db);
|
||||||
|
*
|
||||||
|
* $search = array();
|
||||||
|
* foreach ($object->fields as $key => $val)
|
||||||
|
* {
|
||||||
|
* if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||||
|
* }
|
||||||
|
|
||||||
|
* $fieldstosearchall = array();
|
||||||
|
* foreach ($object->fields as $key => $val)
|
||||||
|
* {
|
||||||
|
* if ($val['searchall']) $fieldstosearchall['t.'.$key] = $val['label'];
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// List of fields to search into when doing a "search in all"
|
||||||
|
$fieldstosearchall = array(
|
||||||
|
'v.rowid'=>"Ref",
|
||||||
|
'v.label'=>"Label",
|
||||||
|
'v.datep'=>"DatePayment",
|
||||||
|
'v.datev'=>"DateValue",
|
||||||
|
'v.amount'=>$langs->trans("Debit").", ".$langs->trans("Credit"),
|
||||||
|
);
|
||||||
|
|
||||||
// Definition of fields for lists
|
// Definition of fields for lists
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
'ref' =>array('label'=>"Ref", 'checked'=>1, 'position'=>100),
|
'ref' =>array('label'=>"Ref", 'checked'=>1, 'position'=>100),
|
||||||
@ -136,8 +167,6 @@ if (empty($reshook)) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) $formaccounting = new FormAccounting($db);
|
if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) $formaccounting = new FormAccounting($db);
|
||||||
if ($arrayfields['bank']['checked'] && !empty($conf->accounting->enabled)) $accountingjournal = new AccountingJournal($db);
|
if ($arrayfields['bank']['checked'] && !empty($conf->accounting->enabled)) $accountingjournal = new AccountingJournal($db);
|
||||||
@ -174,6 +203,7 @@ if ($filtre) {
|
|||||||
$filtre = str_replace(":", "=", $filtre);
|
$filtre = str_replace(":", "=", $filtre);
|
||||||
$sql .= " AND ".$filtre;
|
$sql .= " AND ".$filtre;
|
||||||
}
|
}
|
||||||
|
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
@ -189,6 +219,19 @@ $result = $db->query($sql);
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
|
// Direct jump if only one record found
|
||||||
|
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($result);
|
||||||
|
$id = $obj->rowid;
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// must be place behind the last "header(...)" call
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$total = 0;
|
$total = 0;
|
||||||
|
|
||||||
@ -226,6 +269,12 @@ if ($result)
|
|||||||
|
|
||||||
print_barre_liste($langs->trans("MenuVariousPayment"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($langs->trans("MenuVariousPayment"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
|
if ($search_all)
|
||||||
|
{
|
||||||
|
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
|
||||||
|
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
|
|||||||
@ -119,6 +119,17 @@ if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFOR
|
|||||||
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Miscellaneous payments
|
||||||
|
if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED) && $user->rights->banque->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintomiscpayments'] = array(
|
||||||
|
'position'=>180,
|
||||||
|
'img'=>'object_payment',
|
||||||
|
'label'=>$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
|
||||||
|
'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
|
||||||
|
'url'=>DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)
|
if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)
|
||||||
{
|
{
|
||||||
$arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
|
|||||||
195
htdocs/core/boxes/box_validated_projects.php
Normal file
195
htdocs/core/boxes/box_validated_projects.php
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||||
|
* Copyright (C) 2016 Juan José Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/core/boxes/box_validated_projects.php
|
||||||
|
* \ingroup projet
|
||||||
|
* \brief Module to show validated projects whose tasks are assigned to the connected person, without any time entered by the connected person
|
||||||
|
*/
|
||||||
|
include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to manage the box to show last projet
|
||||||
|
*/
|
||||||
|
class box_validated_projects extends ModeleBoxes
|
||||||
|
{
|
||||||
|
public $boxcode="validated_project";
|
||||||
|
public $boximg="object_projectpub";
|
||||||
|
public $boxlabel;
|
||||||
|
//var $depends = array("projet");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var DoliDB Database handler.
|
||||||
|
*/
|
||||||
|
public $db;
|
||||||
|
|
||||||
|
public $param;
|
||||||
|
|
||||||
|
public $info_box_head = array();
|
||||||
|
public $info_box_contents = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
public function __construct($db, $param = '')
|
||||||
|
{
|
||||||
|
global $user, $langs;
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array('boxes', 'projects'));
|
||||||
|
|
||||||
|
$this->db = $db;
|
||||||
|
$this->boxlabel = "ValidatedProjects";
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->projet->lire);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load data for box to show them later
|
||||||
|
*
|
||||||
|
* @param int $max Maximum number of records to load
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function loadBox($max = 5)
|
||||||
|
{
|
||||||
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
|
$this->max=$max;
|
||||||
|
|
||||||
|
$totalMnt = 0;
|
||||||
|
$totalnb = 0;
|
||||||
|
$totalnbTask=0;
|
||||||
|
|
||||||
|
$textHead = $langs->trans("ValidatedProjects");
|
||||||
|
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
|
||||||
|
|
||||||
|
// list the summary of the orders
|
||||||
|
if ($user->rights->projet->lire) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
$projectstatic = new Project($this->db);
|
||||||
|
|
||||||
|
$socid=0;
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||||
|
|
||||||
|
// Get list of project id allowed to user (in a string list separated by coma)
|
||||||
|
$projectsListId='';
|
||||||
|
if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
|
||||||
|
|
||||||
|
$sql = "SELECT p.rowid, p.ref as Ref, p.fk_soc as Client, p.dateo as startDate,";
|
||||||
|
$sql.= " (SELECT COUNT(t.rowid) FROM ".MAIN_DB_PREFIX."projet_task AS t";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id";
|
||||||
|
$sql.= " WHERE t.fk_projet = p.rowid AND c.fk_c_type_contact != 160 AND c.fk_socpeople = ".$user->id." AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")) AS 'taskNumber'";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet AS p";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id";
|
||||||
|
$sql.= " WHERE p.fk_statut = 1"; // Only open projects
|
||||||
|
$sql.= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")";
|
||||||
|
$sql.= " AND c.fk_socpeople = ".$user->id;
|
||||||
|
$sql.= " GROUP BY p.ref";
|
||||||
|
$sql.= " ORDER BY p.dateo ASC";
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
$num = $this->db->num_rows($result);
|
||||||
|
$i = 0;
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => 'class="nowraponall"',
|
||||||
|
'text' => "Reference projet",
|
||||||
|
);
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => 'class="center"',
|
||||||
|
'text' => 'Client',
|
||||||
|
);
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => 'class="center"',
|
||||||
|
'text' => 'Date debut de projet',
|
||||||
|
);
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => 'class="center"',
|
||||||
|
'text' => 'Nombre de mes tâches sans temps saisi',
|
||||||
|
);
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
while ($i < min($num+1, $max+1)) {
|
||||||
|
$objp = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
$projectstatic->id = $objp->rowid;
|
||||||
|
$projectstatic->ref = $objp->Ref;
|
||||||
|
$projectstatic->customer = $objp->Client;
|
||||||
|
$projectstatic->startDate = $objp->startDate;
|
||||||
|
$projectstatic->taskNumber = $objp->taskNumber;
|
||||||
|
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => 'class="nowraponall"',
|
||||||
|
'text' => $projectstatic->getNomUrl(1),
|
||||||
|
'asis' => 1
|
||||||
|
);
|
||||||
|
|
||||||
|
$sql = 'SELECT rowid, nom FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->Client;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql){
|
||||||
|
$socstatic = new Societe($this->db);
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"',
|
||||||
|
'text' => $obj->nom,
|
||||||
|
'asis' => 1,
|
||||||
|
'url' => DOL_URL_ROOT.'/societe/card.php?socid='.$obj->rowid
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => 'class="center"',
|
||||||
|
'text' => $objp->startDate,
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$i][] = array(
|
||||||
|
'td' => 'class="center"',
|
||||||
|
'text' => $objp->taskNumber." ".$langs->trans("Tasks"),
|
||||||
|
'asis' => 1,
|
||||||
|
);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to show box
|
||||||
|
*
|
||||||
|
* @param array $head Array with properties of box title
|
||||||
|
* @param array $contents Array with properties of box lines
|
||||||
|
* @param int $nooutput No print, only return string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||||
|
{
|
||||||
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1218,13 +1218,13 @@ class ExtraFields
|
|||||||
} else {
|
} else {
|
||||||
$labeltoshow = $obj->{$InfoFieldList[1]};
|
$labeltoshow = $obj->{$InfoFieldList[1]};
|
||||||
}
|
}
|
||||||
$labeltoshow = dol_trunc($labeltoshow, 45);
|
$labeltoshow = $labeltoshow;
|
||||||
|
|
||||||
if ($value == $obj->rowid) {
|
if ($value == $obj->rowid) {
|
||||||
if (!$notrans) {
|
if (!$notrans) {
|
||||||
foreach ($fields_label as $field_toshow) {
|
foreach ($fields_label as $field_toshow) {
|
||||||
$translabel = $langs->trans($obj->$field_toshow);
|
$translabel = $langs->trans($obj->$field_toshow);
|
||||||
$labeltoshow = dol_trunc($translabel, 18).' ';
|
$labeltoshow = $translabel.' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
|
$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
|
||||||
|
|||||||
@ -8667,3 +8667,145 @@ function currentToken()
|
|||||||
{
|
{
|
||||||
return $_SESSION['token'];
|
return $_SESSION['token'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start a table with headers and a optinal clickable number
|
||||||
|
* (don't forget to use "finishSimpleTable()" after the last table row)
|
||||||
|
*
|
||||||
|
* @see finishSimpleTable
|
||||||
|
*
|
||||||
|
* @param string $header The first left header of the table (automatic translated)
|
||||||
|
* @param string $link (optional) The link to a internal dolibarr page, when click on the number (without the first "/")
|
||||||
|
* @param string $arguments (optional) Additional arguments for the link (e.g. "search_status=0")
|
||||||
|
* @param integer $emptyRows (optional) The count of empty rows after the first header
|
||||||
|
* @param integer $number (optional) The number that is shown right after the first header, when not set the link is shown on the right side of the header as "FullList"
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function startSimpleTable($header, $link = "", $arguments = "", $emptyRows = 0, $number = -1)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
|
print $emptyRows < 1 ? '<th>' : '<th colspan="'.($emptyRows + 1).'">';
|
||||||
|
|
||||||
|
print $langs->trans($header);
|
||||||
|
|
||||||
|
// extra space between the first header and the number
|
||||||
|
if ($number > -1) {
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($link)) {
|
||||||
|
if (!empty($arguments)) {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/'.$link.'?'.$arguments.'">';
|
||||||
|
} else {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/'.$link.'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($number > -1) {
|
||||||
|
print '<span class="badge">'.$number.'</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($link)) {
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</th>';
|
||||||
|
|
||||||
|
if ($number < 0 && !empty($link)) {
|
||||||
|
print '<th class="right">';
|
||||||
|
|
||||||
|
if (!empty($arguments)) {
|
||||||
|
print '<a class="commonlink" href="'.DOL_URL_ROOT.'/'.$link.'?'.$arguments.'">';
|
||||||
|
} else {
|
||||||
|
print '<a class="commonlink" href="'.DOL_URL_ROOT.'/'.$link.'">';
|
||||||
|
}
|
||||||
|
|
||||||
|
print $langs->trans("FullList");
|
||||||
|
print '</a>';
|
||||||
|
print '</th>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct HTML close tags for "startSimpleTable(...)"
|
||||||
|
* (use after the last table line)
|
||||||
|
*
|
||||||
|
* @see startSimpleTable
|
||||||
|
*
|
||||||
|
* @param bool $addLineBreak (optional) Add a extra line break after the complete table (\<br\>)
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function finishSimpleTable($addLineBreak = false)
|
||||||
|
{
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
if ($addLineBreak) {
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a summary line to the current open table ("None", "XMoreLines" or "Total xxx")
|
||||||
|
*
|
||||||
|
* @param integer $tableColumnCount The complete count columns of the table
|
||||||
|
* @param integer $num The count of the rows of the table, when it is zero (0) the "$noneWord" is shown instead
|
||||||
|
* @param integer $nbofloop (optional) The maximum count of rows thaht the table show (when it is zero (0) no summary line will show, expect "$noneWord" when $num === 0)
|
||||||
|
* @param integer $total (optional) The total value thaht is shown after when the table has minimum of one entire
|
||||||
|
* @param string $noneWord (optional) The word that is shown when the table has no entires ($num === 0)
|
||||||
|
* @param boolean $extraRightColumn (optional) Add a addtional column after the summary word and total number
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function addSummaryTableLine($tableColumnCount, $num, $nbofloop = 0, $total = 0, $noneWord = "None", $extraRightColumn = false)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
if ($num === 0) {
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td colspan="'.$tableColumnCount.'" class="opacitymedium">'.$langs->trans($noneWord).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($nbofloop === 0)
|
||||||
|
{
|
||||||
|
// don't show a summary line
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($num === 0) {
|
||||||
|
$colspan = $tableColumnCount;
|
||||||
|
}
|
||||||
|
elseif ($num > $nbofloop) {
|
||||||
|
$colspan = $tableColumnCount;
|
||||||
|
} else {
|
||||||
|
$colspan = $tableColumnCount - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($extraRightColumn) {
|
||||||
|
$colspan--;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
|
||||||
|
if ($nbofloop > 0 && $num > $nbofloop) {
|
||||||
|
print '<td colspan="'.$colspan.'" class="right">'.$langs->trans("XMoreLines", ($num - $nbofloop)).'</td>';
|
||||||
|
} else {
|
||||||
|
print '<td colspan="'.$colspan.'" class="right"> '.$langs->trans("Total").'</td>';
|
||||||
|
print '<td class="right" width="100">'.price($total).'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($extraRightColumn) {
|
||||||
|
print '<td></td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|||||||
@ -144,6 +144,8 @@ class modProjet extends DolibarrModules
|
|||||||
$r++;
|
$r++;
|
||||||
$this->boxes[$r][1] = "box_task.php";
|
$this->boxes[$r][1] = "box_task.php";
|
||||||
$r++;
|
$r++;
|
||||||
|
$this->boxes[$r][1] = "box_validated_projects.php";
|
||||||
|
$r++;
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$this->rights = array();
|
$this->rights = array();
|
||||||
|
|||||||
@ -1879,9 +1879,9 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
$tickettocreate->subject = $subject;
|
$tickettocreate->subject = $subject;
|
||||||
$tickettocreate->message = $description;
|
$tickettocreate->message = $description;
|
||||||
$tickettocreate->type_code = 0;
|
$tickettocreate->type_code = (!empty($conf->global->MAIN_EMAILCOLLECTOR_TICKET_TYPE_CODE) ? $conf->global->MAIN_EMAILCOLLECTOR_TICKET_TYPE_CODE : dol_getIdFromCode($this->db, 1, 'c_ticket_type', 'use_default', 'code', 1));
|
||||||
$tickettocreate->category_code = null;
|
$tickettocreate->category_code = (!empty($conf->global->MAIN_EMAILCOLLECTOR_TICKET_CATEGORY_CODE) ? $conf->global->MAIN_EMAILCOLLECTOR_TICKET_CATEGORY_CODE : dol_getIdFromCode($this->db, 1, 'c_ticket_category', 'use_default', 'code', 1));
|
||||||
$tickettocreate->severity_code = null;
|
$tickettocreate->severity_code = (!empty($conf->global->MAIN_EMAILCOLLECTOR_TICKET_SEVERITY_CODE) ? $conf->global->MAIN_EMAILCOLLECTOR_TICKET_SEVERITY_CODE : dol_getIdFromCode($this->db, 1, 'c_ticket_severity', 'use_default', 'code', 1));
|
||||||
$tickettocreate->origin_email = $from;
|
$tickettocreate->origin_email = $from;
|
||||||
$tickettocreate->fk_user_create = $user->id;
|
$tickettocreate->fk_user_create = $user->id;
|
||||||
$tickettocreate->datec = $date;
|
$tickettocreate->datec = $date;
|
||||||
|
|||||||
@ -104,3 +104,4 @@ BoxTitleLastCustomerShipments=Latest %s customer shipments
|
|||||||
NoRecordedShipments=No recorded customer shipment
|
NoRecordedShipments=No recorded customer shipment
|
||||||
# Pages
|
# Pages
|
||||||
AccountancyHome=Accountancy
|
AccountancyHome=Accountancy
|
||||||
|
ValidatedProjects=Validated projects
|
||||||
|
|||||||
@ -1011,6 +1011,7 @@ SearchIntoCustomerShipments=Customer shipments
|
|||||||
SearchIntoExpenseReports=Expense reports
|
SearchIntoExpenseReports=Expense reports
|
||||||
SearchIntoLeaves=Leave
|
SearchIntoLeaves=Leave
|
||||||
SearchIntoTickets=Tickets
|
SearchIntoTickets=Tickets
|
||||||
|
SearchIntoMiscPayments=Miscellaneous payments
|
||||||
CommentLink=Comments
|
CommentLink=Comments
|
||||||
NbComments=Number of comments
|
NbComments=Number of comments
|
||||||
CommentPage=Comments space
|
CommentPage=Comments space
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user