Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
43aad33713
@ -8,8 +8,9 @@ For Users:
|
||||
NEW: Stable module: Website
|
||||
NEW: Stable module: WebDAV
|
||||
NEW: Stable module: Module Builder
|
||||
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools.
|
||||
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more services.
|
||||
NEW: Experimental module "TakePos"
|
||||
NEW: Experimental module "Ticket"
|
||||
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
|
||||
Android application like DoliDroid able to provide native features for multicompany module.
|
||||
NEW: Compatibility with PHP 7.3
|
||||
@ -22,10 +23,10 @@ For developers:
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must
|
||||
* If you use some links like viewimages.php?modulepart=mycompany&file=... in your external modules, you must
|
||||
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
|
||||
modulepart=mycompany that now works like others).
|
||||
|
||||
* Hidden option MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT has been renamed into SHIPPING_PDF_DISPLAY_AMOUNT_HT
|
||||
|
||||
|
||||
***** ChangeLog for 8.0.3 compared to 8.0.2 *****
|
||||
|
||||
@ -907,7 +907,7 @@ else
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'"></td></tr>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'" autofocus="autofocus"></td></tr>';
|
||||
}
|
||||
|
||||
// Password
|
||||
|
||||
@ -86,7 +86,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('adherent');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -53,13 +53,15 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
if (! $sortfield) { $sortfield="c.dateadh"; }
|
||||
|
||||
$object = new Subscription($db);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('subscriptionlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('subscription');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -317,7 +317,7 @@ if ($action == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" size="40"></td></tr>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print $form->selectyesno("subscription",1,1);
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -17,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/emailcollectore/emailcollector_card.php
|
||||
* \file htdocs/admin/emailcollector_card.php
|
||||
* \ingroup emailcollector
|
||||
* \brief Page to create/edit/view emailcollector
|
||||
*/
|
||||
@ -27,16 +26,18 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
|
||||
dol_include_once('/emailcollector/class/emailcollector.class.php');
|
||||
dol_include_once('/emailcollector/lib/emailcollector.lib.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollector.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectorfilter.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("admin", "other"));
|
||||
$langs->loadLangs(array("admin", "mails", "other"));
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
@ -54,7 +55,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration
|
||||
$hookmanager->initHooks(array('emailcollectorcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('emailcollector');
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_');
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = trim(GETPOST("search_all", 'alpha'));
|
||||
@ -121,6 +122,73 @@ if ($action == 'confirm_collect')
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if (GETPOST('addfilter','alpha'))
|
||||
{
|
||||
$emailcollectorfilter = new EmailCollectorFilter($db);
|
||||
$emailcollectorfilter->type = GETPOST('filtertype','az09');
|
||||
$emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha');
|
||||
$emailcollectorfilter->fk_emailcollector = $object->id;
|
||||
$emailcollectorfilter->status = 1;
|
||||
$result = $emailcollectorfilter->create($user);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$object->fetchFilters();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'deletefilter')
|
||||
{
|
||||
$emailcollectorfilter = new EmailCollectorFilter($db);
|
||||
$emailcollectorfilter->fetch(GETPOST('filterid','int'));
|
||||
$result = $emailcollectorfilter->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$object->fetchFilters();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('addoperation','alpha'))
|
||||
{
|
||||
$emailcollectoroperation = new EmailCollectorAction($db);
|
||||
$emailcollectoroperation->type = GETPOST('operationtype','az09');
|
||||
$emailcollectoroperation->actionparam = GETPOST('actionparam', 'alpha');
|
||||
$emailcollectoroperation->fk_emailcollector = $object->id;
|
||||
$emailcollectoroperation->status = 1;
|
||||
$result = $emailcollectoroperation->create($user);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$object->fetchActions();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'deleteoperation')
|
||||
{
|
||||
$emailcollectoroperation = new EmailCollectorAction($db);
|
||||
$emailcollectoroperation->fetch(GETPOST('operationid','int'));
|
||||
$result = $emailcollectoroperation->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$object->fetchActions();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -219,6 +287,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$object->fetchFilters();
|
||||
$object->fetchActions();
|
||||
|
||||
$head = emailcollectorPrepareHead($object);
|
||||
dol_fiche_head($head, 'card', $langs->trans("EmailCollector"), -1, 'emailcollector');
|
||||
|
||||
@ -318,6 +389,90 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="updatefiltersactions">';
|
||||
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
|
||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||
|
||||
// Filters
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Filters").'</td><td></td><td></td>';
|
||||
print '</tr>';
|
||||
// Add filter
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$arrayoftypes=array('from'=>'MailFrom', 'to'=>'MailTo', 'cc'=>'Cc', 'bcc'=>'Bcc', 'subject'=>'Subject', 'body'=>'Body', 'seen'=>'AlreadyRead', 'unseen'=>'NotRead');
|
||||
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1);
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="rulevalue">';
|
||||
print '</td>';
|
||||
print '<td align="right"><input type="submit" name="addfilter" id="addfilter" class="flat button" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
// List filters
|
||||
foreach($object->filters as $rulefilter)
|
||||
{
|
||||
$rulefilterobj=new EmailCollectorFilter($db);
|
||||
$rulefilterobj->fetch($rulefilter['id']);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans($arrayoftypes[$rulefilter['type']]);
|
||||
print '</td>';
|
||||
print '<td>'.$rulefilter['rulevalue'].'</td>';
|
||||
print '<td align="right">';
|
||||
//print $rulefilterobj->getLibStatut(3);
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletefilter&filterid='.$rulefilter['id'].'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<div class="clearboth"></div><br>';
|
||||
|
||||
// Operations
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("EmailcollectorOperations").'</td><td></td><td></td>';
|
||||
print '</tr>';
|
||||
// Add operation
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$arrayoftypes=array('recordevent'=>'RecordEvent');
|
||||
if ($conf->projet->enabled) $arrayoftypes['project']='CreateLeadAndThirdParty';
|
||||
print $form->selectarray('operationtype', $arrayoftypes, '', 0, 0, 0, '', 1);
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="operationparam">';
|
||||
print '</td>';
|
||||
print '<td align="right"><input type="submit" name="addoperation" id="addoperation" class="flat button" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
// List operations
|
||||
foreach($object->actions as $ruleaction)
|
||||
{
|
||||
$ruleactionobj=new EmailcollectorAction($db);
|
||||
$ruleactionobj->fetch($ruleaction['id']);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans($arrayoftypes[$ruleaction['type']]);
|
||||
print '</td>';
|
||||
print '<td>'.$ruleaction['actionparam'].'</td>';
|
||||
print '<td align="right">';
|
||||
//print $ruleactionobj->getLibStatut(3);
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteoperation&operationid='.$ruleaction['id'].'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration
|
||||
$hookmanager->initHooks(array('emailcollectorlist')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('emailcollector');
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_');
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||
|
||||
@ -61,7 +61,7 @@ $diroutputmassaction=$conf->admin->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('emailsenderprofile');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||
|
||||
@ -41,6 +41,7 @@ $langs->loadLangs(array("errors","admin","modulebuilder"));
|
||||
$mode=GETPOST('mode', 'alpha');
|
||||
if (empty($mode)) $mode='common';
|
||||
$action=GETPOST('action','alpha');
|
||||
//var_dump($_POST);exit;
|
||||
$value=GETPOST('value', 'alpha');
|
||||
$page_y=GETPOST('page_y','int');
|
||||
$search_keyword=GETPOST('search_keyword','alpha');
|
||||
@ -1010,8 +1011,39 @@ if ($mode == 'deploy')
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print '<input type="hidden" name="mode" value="deploy">';
|
||||
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
|
||||
|
||||
print $langs->trans("YouCanSubmitFile");
|
||||
|
||||
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
|
||||
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
||||
if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp*1;
|
||||
if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024;
|
||||
if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024;
|
||||
if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024;
|
||||
// Now $max and $maxphp are in Kb
|
||||
$maxmin = $max;
|
||||
if ($maxphp > 0) $maxmin=min($max,$maxphp);
|
||||
|
||||
if ($maxmin > 0)
|
||||
{
|
||||
print '<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
jQuery("#fileinstall").on("change", function() {
|
||||
if(this.files[0].size > '.($maxmin*1024).'){
|
||||
alert("'.dol_escape_js($langs->trans("ErrorFileSizeTooLarge")).'");
|
||||
this.value = "";
|
||||
};
|
||||
});
|
||||
});
|
||||
</script>'."\n";
|
||||
// MAX_FILE_SIZE doit précéder le champ input de type file
|
||||
print '<input type="hidden" name="max_file_size" value="'.($maxmin*1024).'">';
|
||||
}
|
||||
|
||||
print '<input class="flat minwidth400" type="file" name="fileinstall" id="fileinstall"> ';
|
||||
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -45,7 +45,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('asset');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all=trim(GETPOST("search_all",'alpha'));
|
||||
|
||||
@ -62,7 +62,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('asset');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||
|
||||
@ -74,10 +74,14 @@ $filtert = GETPOST("filtert","int",3);
|
||||
$usergroup = GETPOST("usergroup","int",3);
|
||||
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new ActionComm($db);
|
||||
$hookmanager->initHooks(array('agendalist'));
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('actioncomm');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
// If not choice done on calendar owner, we filter on user.
|
||||
if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS))
|
||||
{
|
||||
@ -117,10 +121,6 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi
|
||||
$filtert=$user->id;
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new ActionComm($db);
|
||||
$hookmanager->initHooks(array('agendalist'));
|
||||
|
||||
$arrayfields=array(
|
||||
'a.id'=>array('label'=>"Ref", 'checked'=>1),
|
||||
'owner'=>array('label'=>"Owner", 'checked'=>1),
|
||||
|
||||
@ -747,7 +747,7 @@ if ($action == 'create')
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth300" name="titre" value="'.dol_escape_htmltag(GETPOST('titre')).'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth300" name="titre" value="'.dol_escape_htmltag(GETPOST('titre')).'" autofocus="autofocus"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO)?$conf->global->MAILING_EMAIL_ERRORSTO:$conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
||||
|
||||
|
||||
@ -46,20 +46,21 @@ $search_all=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all'
|
||||
$search_ref=GETPOST("search_ref", "alpha") ? GETPOST("search_ref", "alpha") : GETPOST("sref", "alpha");
|
||||
$filteremail=GETPOST('filteremail','alpha');
|
||||
|
||||
$object = new Mailing($db);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('mailinglist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('mailing');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
'm.titre'=>'Ref',
|
||||
);
|
||||
|
||||
$object = new Mailing($db);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('propal');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -108,7 +108,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('commande');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -129,7 +129,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('banktransaction');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost('banktransaction','','search_');
|
||||
|
||||
$arrayfields=array(
|
||||
'b.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||
|
||||
@ -74,7 +74,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('bank_account');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -94,7 +94,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('facture_rec');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php
|
||||
|
||||
@ -108,7 +108,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('facture_rec');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php
|
||||
|
||||
@ -134,7 +134,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('facture');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -636,7 +636,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("ContributionsToPay").($num?' <a href="'.DOL_URL_ROOT.'/compta/sociales/index.php?status=0"><span class="badge">'.$num.'</span></a>':'').'</th>';
|
||||
print '<th>'.$langs->trans("ContributionsToPay").($num?' <a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?status=0"><span class="badge">'.$num.'</span></a>':'').'</th>';
|
||||
print '<th align="center">'.$langs->trans("DateDue").'</th>';
|
||||
print '<th align="right">'.$langs->trans("AmountTTC").'</th>';
|
||||
print '<th align="right">'.$langs->trans("Paid").'</th>';
|
||||
|
||||
@ -773,7 +773,7 @@ else
|
||||
|
||||
print '<tr class="oddeven"><td> </td>';
|
||||
|
||||
print "<td>".$langs->trans("Salary")." <a href=\"".DOL_URL_ROOT."/compta/salaries/index.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
print "<td>".$langs->trans("Salary")." <a href=\"".DOL_URL_ROOT."/compta/salaries/list.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount).'</td>';
|
||||
print '<td align="right">'.price(-$obj->amount).'</td>';
|
||||
|
||||
@ -174,7 +174,7 @@ if ($action == 'delete')
|
||||
if ($result >= 0)
|
||||
{
|
||||
$db->commit();
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/salaries/index.php');
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/salaries/list.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -365,7 +365,7 @@ if ($id)
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
|
||||
|
||||
@ -537,24 +537,73 @@ class PaymentSalary extends CommonObject
|
||||
/**
|
||||
* Send name clicable (with possibly the picto)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param string $option link option
|
||||
* @return string Chaine with URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param string $option link option
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chaine with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
|
||||
{
|
||||
global $langs;
|
||||
global $db, $conf, $langs, $hookmanager;
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
global $menumanager;
|
||||
|
||||
$result='';
|
||||
$label=$langs->trans("ShowSalaryPayment").': '.$this->ref;
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$result = '';
|
||||
|
||||
$label = '<u>' . $langs->trans("ShowSalaryPayment") . '</u>';
|
||||
$label.= '<br>';
|
||||
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
|
||||
$url = DOL_URL_ROOT.'/compta/salaries/card.php?id='.$this->id;
|
||||
|
||||
if ($option != 'nolink')
|
||||
{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
}
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowMyObject");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||
|
||||
/*
|
||||
$hookmanager->initHooks(array('myobjectdao'));
|
||||
$parameters=array('id'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
||||
*/
|
||||
}
|
||||
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
$result .= $linkstart;
|
||||
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
|
||||
if ($withpicto != 2) $result.= $this->ref;
|
||||
$result .= $linkend;
|
||||
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||
|
||||
global $action,$hookmanager;
|
||||
$hookmanager->initHooks(array('salarypayment'));
|
||||
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
|
||||
$reshook=$hookmanager->executeHooks('getNomUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) $result = $hookmanager->resPrint;
|
||||
else $result .= $hookmanager->resPrint;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ if ($object->id)
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ $head = salaries_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("SalaryPayment"), -1, 'payment');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/salaries/index.php
|
||||
* \file htdocs/compta/salaries/list.php
|
||||
* \ingroup salaries
|
||||
* \brief List of salaries payments
|
||||
*/
|
||||
@ -231,6 +231,7 @@ if ($result)
|
||||
|
||||
$salstatic->id=$obj->rowid;
|
||||
$salstatic->ref=$obj->rowid;
|
||||
|
||||
// Ref
|
||||
print "<td>".$salstatic->getNomUrl(1)."</td>\n";
|
||||
// Employee
|
||||
@ -481,7 +481,7 @@ if ($id > 0)
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/index.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@ if ($object->id)
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/index.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ if (! empty($conf->projet->enabled))
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/index.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/sociales/index.php
|
||||
* \file htdocs/compta/list/index.php
|
||||
* \ingroup tax
|
||||
* \brief Page to list all social contributions
|
||||
*/
|
||||
@ -55,19 +55,19 @@ if (! $sortorder) $sortorder="DESC";
|
||||
$year=GETPOST("year",'int');
|
||||
$filtre=GETPOST("filtre",'int');
|
||||
|
||||
if (empty($_REQUEST['typeid']))
|
||||
if (! GETPOSTISSET('search_typeid'))
|
||||
{
|
||||
$newfiltre=str_replace('filtre=','',$filtre);
|
||||
$filterarray=explode('-',$newfiltre);
|
||||
foreach($filterarray as $val)
|
||||
{
|
||||
$part=explode(':',$val);
|
||||
if ($part[0] == 'cs.fk_type') $typeid=$part[1];
|
||||
if ($part[0] == 'cs.fk_type') $search_typeid=$part[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$typeid=$_REQUEST['typeid'];
|
||||
$search_typeid=GETPOST('search_typeid','int');
|
||||
}
|
||||
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
@ -76,11 +76,12 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
$search_label="";
|
||||
$search_amount="";
|
||||
$search_status='';
|
||||
$typeid="";
|
||||
$search_typeid="";
|
||||
$year="";
|
||||
$month="";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -118,8 +119,8 @@ if ($filtre) {
|
||||
$filtre=str_replace(":","=",$filtre);
|
||||
$sql .= " AND ".$filtre;
|
||||
}
|
||||
if ($typeid) {
|
||||
$sql .= " AND cs.fk_type=".$db->escape($typeid);
|
||||
if ($search_typeid) {
|
||||
$sql .= " AND cs.fk_type=".$db->escape($search_typeid);
|
||||
}
|
||||
$sql.= " GROUP BY cs.rowid, cs.fk_type, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
@ -139,10 +140,14 @@ if ($resql)
|
||||
$i = 0;
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($year) $param.='&year='.$year;
|
||||
if ($typeid) $param.='&typeid='.$typeid;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
|
||||
if ($search_label) $param.='&search_label='.urlencode($search_label);
|
||||
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
|
||||
if ($search_typeid) $param.='&search_typeid='.urlencode($search_typeid);
|
||||
if ($search_status != '' && $search_status != '-1') $param.='&search_status='.urlencode($search_status);
|
||||
if ($year) $param.='&year='.urlencode($year);
|
||||
|
||||
$newcardbutton='';
|
||||
if($user->rights->tax->charges->creer)
|
||||
@ -193,7 +198,7 @@ if ($resql)
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
// Type
|
||||
print '<td class="liste_titre" align="left">';
|
||||
$formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,0,0,'maxwidth100onsmartphone');
|
||||
$formsocialcontrib->select_type_socialcontrib($search_typeid,'search_typeid',1,0,0,'maxwidth100onsmartphone');
|
||||
print '</td>';
|
||||
// Period end date
|
||||
print '<td class="liste_titre"> </td>';
|
||||
@ -133,7 +133,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('contact');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -100,7 +100,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('contrat');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
'c.ref'=>'Ref',
|
||||
|
||||
@ -84,7 +84,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('contratdet');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Security check
|
||||
$contratid = GETPOST('id','int');
|
||||
|
||||
@ -1941,24 +1941,36 @@ class ExtraFields
|
||||
/**
|
||||
* return array_options array of data of extrafields value of object sent by a search form
|
||||
*
|
||||
* @param array $extralabels $array of extrafields (@deprecated)
|
||||
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
||||
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
|
||||
* @return array|int array_options set or 0 if no value
|
||||
* @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage)
|
||||
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
||||
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
|
||||
* @return array|int array_options set or 0 if no value
|
||||
*/
|
||||
function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='')
|
||||
function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix='', $keysuffix='')
|
||||
{
|
||||
global $_POST;
|
||||
|
||||
if (is_array($this->attributes[$object->table_element]['label'])) $extralabels=$this->attributes[$object->table_element]['label'];
|
||||
if (is_string($extrafieldsobjectkey) && is_array($this->attributes[$extrafieldsobjectkey]['label']))
|
||||
{
|
||||
$extralabels = $this->attributes[$extrafieldsobjectkey]['label'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$extralabels = $extrafieldsobjectkey;
|
||||
}
|
||||
|
||||
$array_options = array();
|
||||
if (is_array($extralabels))
|
||||
{
|
||||
$array_options = array();
|
||||
|
||||
// Get extra fields
|
||||
foreach ($extralabels as $key => $value)
|
||||
{
|
||||
$key_type = $this->attributes[$object->table_element]['type'][$key];
|
||||
$key_type = '';
|
||||
if (is_string($extrafieldsobjectkey))
|
||||
{
|
||||
$key_type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
|
||||
}
|
||||
|
||||
if (in_array($key_type,array('date','datetime')))
|
||||
{
|
||||
@ -1987,8 +1999,7 @@ class ExtraFields
|
||||
|
||||
return $array_options;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,6 +132,7 @@ class FormFile
|
||||
|
||||
if ($maxmin > 0)
|
||||
{
|
||||
// MAX_FILE_SIZE doit précéder le champ input de type file
|
||||
$out .= '<input type="hidden" name="max_file_size" value="'.($maxmin*1024).'">';
|
||||
}
|
||||
|
||||
@ -1017,7 +1018,7 @@ class FormFile
|
||||
global $form;
|
||||
|
||||
$disablecrop=1;
|
||||
if (in_array($modulepart, array('societe','product','produit','service','expensereport','holiday','member','project','ticket','user'))) $disablecrop=0;
|
||||
if (in_array($modulepart, array('expensereport','holiday','member','project','product','produit','service','societe','tax','ticket','user'))) $disablecrop=0;
|
||||
|
||||
// Define relative path used to store the file
|
||||
if (empty($relativepath))
|
||||
|
||||
@ -317,14 +317,20 @@ class FormProjets
|
||||
* @param string $morecss More css added to the select component
|
||||
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
|
||||
* @param string $showproject 'all' = Show project info, ''=Hide project info
|
||||
* @param User $usertofilter User object to use for filtering
|
||||
* @return int Nbr of project if OK, <0 if KO
|
||||
*/
|
||||
function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all')
|
||||
function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all', $usertofilter=null)
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
if (is_null($usertofilter))
|
||||
{
|
||||
$usertofilter = $user;
|
||||
}
|
||||
|
||||
$out='';
|
||||
|
||||
$hideunselectables = false;
|
||||
@ -332,10 +338,10 @@ class FormProjets
|
||||
|
||||
if (empty($projectsListId))
|
||||
{
|
||||
if (empty($user->rights->projet->all->lire))
|
||||
if (empty($usertofilter->rights->projet->all->lire))
|
||||
{
|
||||
$projectstatic=new Project($this->db);
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter,0,1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -381,7 +387,7 @@ class FormProjets
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
// If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project.
|
||||
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire))
|
||||
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire))
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@ -908,7 +908,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
{
|
||||
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
|
||||
}
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element,'','search_');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
|
||||
@ -7288,7 +7288,8 @@ function dol_getmypid()
|
||||
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
|
||||
* If param $mode is 2, can contains a list of int id separated by comma like "1,3,4"
|
||||
* If param $mode is 3, can contains a list of string separated by comma like "a,b,c"
|
||||
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
|
||||
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of ID separated with comma (Example '1,3,4')
|
||||
* 3=value is list of string separated with comma (Example 'text 1,text 2'), 4=value is a list of ID separated with comma (Example '1,3,4') for search into a multiselect string ('1,2')
|
||||
* @param integer $nofirstand 1=Do not output the first 'AND'
|
||||
* @return string $res The statement to append to the SQL query
|
||||
*/
|
||||
@ -7372,11 +7373,9 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
||||
else if ($mode == 4)
|
||||
{
|
||||
$tmparray=explode(',',trim($crit));
|
||||
|
||||
if (count($tmparray))
|
||||
{
|
||||
$listofcodes='';
|
||||
|
||||
foreach($tmparray as $val)
|
||||
{
|
||||
if ($val)
|
||||
@ -7385,7 +7384,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
||||
$newres .= ' OR '. $field . ' = \'' . $db->escape(trim($val)) . '\'';
|
||||
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\'';
|
||||
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\'';
|
||||
$newres .= ')';
|
||||
$newres .= ')';
|
||||
$i2++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,15 +205,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=billing', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__);
|
||||
-- Special expenses
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/list.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/stats/index.php?leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/list.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__);
|
||||
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__);
|
||||
|
||||
@ -906,9 +906,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
// Social contributions
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
$newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
|
||||
$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire);
|
||||
// VAT
|
||||
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
|
||||
@ -948,9 +948,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
$langs->load("salaries");
|
||||
$newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary');
|
||||
$newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary');
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->read);
|
||||
}
|
||||
|
||||
@ -958,7 +958,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$langs->load("loan");
|
||||
$newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan');
|
||||
$newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan');
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write);
|
||||
//if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read);
|
||||
}
|
||||
|
||||
@ -146,8 +146,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$this->posxqtytoship=$this->page_largeur - $this->marge_droite - 28;
|
||||
$this->posxpuht=$this->page_largeur - $this->marge_droite;
|
||||
|
||||
if (!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
|
||||
|
||||
if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) { // Show also the prices
|
||||
$this->posxweightvol=$this->page_largeur - $this->marge_droite - 118;
|
||||
$this->posxqtyordered=$this->page_largeur - $this->marge_droite - 96;
|
||||
$this->posxqtytoship=$this->page_largeur - $this->marge_droite - 68;
|
||||
@ -173,7 +172,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
@ -187,7 +186,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
*/
|
||||
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
// phpcs:enable
|
||||
global $user,$conf,$langs,$hookmanager;
|
||||
|
||||
$object->fetch_thirdparty();
|
||||
@ -533,8 +532,11 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0,"volume");
|
||||
}
|
||||
|
||||
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');
|
||||
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
|
||||
if (empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME))
|
||||
{
|
||||
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');
|
||||
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
|
||||
}
|
||||
|
||||
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
||||
{
|
||||
@ -542,10 +544,13 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked,'','C');
|
||||
}
|
||||
|
||||
$pdf->SetXY($this->posxqtytoship, $curY);
|
||||
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C');
|
||||
if (empty($conf->global->SHIPPING_PDF_HIDE_QTYTOSHIP))
|
||||
{
|
||||
$pdf->SetXY($this->posxqtytoship, $curY);
|
||||
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C');
|
||||
}
|
||||
|
||||
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT))
|
||||
if(!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT))
|
||||
{
|
||||
$pdf->SetXY($this->posxpuht, $curY);
|
||||
$pdf->MultiCell(($this->posxtotalht - $this->posxpuht-1), 3, price($object->lines[$i]->subprice, 0, $outputlangs),'','R');
|
||||
@ -653,7 +658,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show total to pay
|
||||
*
|
||||
@ -666,7 +671,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
// phpcs:enable
|
||||
global $conf,$mysoc;
|
||||
|
||||
$sign=1;
|
||||
@ -720,11 +725,14 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1);
|
||||
}
|
||||
|
||||
$pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1);
|
||||
|
||||
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
|
||||
if (empty($conf->global->SHIPPING_PDF_HIDE_QTYTOSHIP))
|
||||
{
|
||||
$pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1);
|
||||
}
|
||||
|
||||
if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT))
|
||||
{
|
||||
$pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1);
|
||||
|
||||
@ -732,22 +740,25 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1);
|
||||
}
|
||||
|
||||
// Total Weight
|
||||
if ($totalWeighttoshow)
|
||||
if (empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME))
|
||||
{
|
||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1);
|
||||
// Total Weight
|
||||
if ($totalWeighttoshow)
|
||||
{
|
||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1);
|
||||
|
||||
$index++;
|
||||
}
|
||||
if ($totalVolumetoshow)
|
||||
{
|
||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1);
|
||||
$index++;
|
||||
}
|
||||
if ($totalVolumetoshow)
|
||||
{
|
||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1);
|
||||
|
||||
$index++;
|
||||
$index++;
|
||||
}
|
||||
if (! $totalWeighttoshow && ! $totalVolumetoshow) $index++;
|
||||
}
|
||||
if (! $totalWeighttoshow && ! $totalVolumetoshow) $index++;
|
||||
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
@ -794,11 +805,14 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$pdf->MultiCell($this->posxqtyordered - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxweightvol-1, $tab_top, $this->posxweightvol-1, $tab_top + $tab_height);
|
||||
if (empty($hidetop))
|
||||
if (empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME))
|
||||
{
|
||||
$pdf->SetXY($this->posxweightvol-1, $tab_top+1);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"),'','C');
|
||||
$pdf->line($this->posxweightvol-1, $tab_top, $this->posxweightvol-1, $tab_top + $tab_height);
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxweightvol-1, $tab_top+1);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
||||
@ -811,14 +825,17 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height);
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxqtytoship, $tab_top+1);
|
||||
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C');
|
||||
}
|
||||
if (empty($conf->global->SHIPPING_PDF_HIDE_QTYTOSHIP))
|
||||
{
|
||||
$pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height);
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxqtytoship, $tab_top+1);
|
||||
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
|
||||
if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) {
|
||||
|
||||
$pdf->line($this->posxpuht-1, $tab_top, $this->posxpuht-1, $tab_top + $tab_height);
|
||||
if (empty($hidetop))
|
||||
|
||||
@ -52,7 +52,7 @@ class modEmailCollector extends DolibarrModules
|
||||
// It is used to group modules by family in module setup page
|
||||
$this->family = "interface";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '75';
|
||||
$this->module_position = '12';
|
||||
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
||||
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
||||
|
||||
@ -70,7 +70,7 @@ class modEmailCollector extends DolibarrModules
|
||||
// Name of image file used for this module.
|
||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||
$this->picto='generic';
|
||||
$this->picto='email';
|
||||
|
||||
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
|
||||
// for default path (eg: /dav/core/xxxxx) (0=disable, 1=enable)
|
||||
|
||||
@ -49,6 +49,8 @@ class modGravatar extends DolibarrModules
|
||||
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
||||
// It is used to group modules in module setup page
|
||||
$this->family = "interface";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '75';
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||
|
||||
@ -43,6 +43,8 @@ class modLdap extends DolibarrModules
|
||||
$this->numero = 200;
|
||||
|
||||
$this->family = "interface";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '30';
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "Synchronisation Ldap";
|
||||
|
||||
@ -44,7 +44,12 @@ class modMailing extends DolibarrModules
|
||||
$this->db = $db;
|
||||
$this->numero = 22;
|
||||
|
||||
$this->family = "technic";
|
||||
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
||||
// It is used to group modules by family in module setup page
|
||||
$this->family = "interface";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '11';
|
||||
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "Gestion des EMailings";
|
||||
|
||||
@ -43,7 +43,11 @@ class modMailmanSpip extends DolibarrModules
|
||||
$this->db = $db;
|
||||
$this->numero = 105;
|
||||
|
||||
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
||||
// It is used to group modules in module setup page
|
||||
$this->family = "interface";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '70';
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "Mailman or Spip interface for member module";
|
||||
|
||||
@ -41,7 +41,11 @@ class modNotification extends DolibarrModules
|
||||
$this->db = $db;
|
||||
$this->numero = 600;
|
||||
|
||||
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
||||
// It is used to group modules in module setup page
|
||||
$this->family = "interface";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '01';
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "EMail notifications (push) on business Dolibarr events";
|
||||
|
||||
@ -47,7 +47,7 @@ class modOauth extends DolibarrModules
|
||||
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
||||
// It is used to group modules in module setup page
|
||||
$this->family = "interface";
|
||||
$this->module_position = '51';
|
||||
$this->module_position = '31';
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||
|
||||
@ -107,21 +107,21 @@ class modPaypal extends DolibarrModules
|
||||
// Main menu entries
|
||||
$this->menus = array(); // List of menus to add
|
||||
$r=0;
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'mainmenu'=>'billing',
|
||||
'leftmenu'=>'customers_bills_payment_paypal',
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'PaypalImportPayment',
|
||||
'url'=>'/paypal/importpayments.php',
|
||||
'langs'=>'paypal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>501,
|
||||
'enabled'=>'$conf->paypal->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
/*$this->menu[$r]=array(
|
||||
'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'mainmenu'=>'billing',
|
||||
'leftmenu'=>'customers_bills_payment_paypal',
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'PaypalImportPayment',
|
||||
'url'=>'/paypal/importpayments.php',
|
||||
'langs'=>'paypal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>501,
|
||||
'enabled'=>'$conf->paypal->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
$r++;*/
|
||||
|
||||
// Add here entries to declare new menus
|
||||
// Example to declare the Top Menu entry:
|
||||
|
||||
@ -46,6 +46,8 @@ class modSocialNetworks extends DolibarrModules
|
||||
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
||||
// It is used to group modules in module setup page
|
||||
$this->family = "interface";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '20';
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "Enable Social Networks fields into third parties and addresses (skype, twitter, facebook, ...)";
|
||||
|
||||
@ -92,7 +92,7 @@ class modStripe extends DolibarrModules
|
||||
|
||||
// Main menu entries
|
||||
$r=0;
|
||||
$this->menu[$r]=array(
|
||||
/* $this->menu[$r]=array(
|
||||
'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'mainmenu'=>'billing',
|
||||
'leftmenu'=>'customers_bills_payment_stripe',
|
||||
@ -106,7 +106,7 @@ class modStripe extends DolibarrModules
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
$r++;*/
|
||||
|
||||
$this->menu[$r] = array(
|
||||
'fk_menu'=>'fk_mainmenu=bank',
|
||||
|
||||
@ -247,7 +247,7 @@ class pdf_stdmovement extends ModelePDFMovement
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('movement');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost('movement','','search_');
|
||||
|
||||
$productlot=new ProductLot($db);
|
||||
$productstatic=new Product($db);
|
||||
|
||||
@ -83,6 +83,12 @@ elseif ($modulepart == 'societe')
|
||||
if (! $user->rights->societe->lire) accessforbidden();
|
||||
$accessallowed=1;
|
||||
}
|
||||
elseif ($modulepart == 'tax')
|
||||
{
|
||||
$result=restrictedArea($user, 'tax', $id, 'chargesociales','charges');
|
||||
if (! $user->rights->tax->charges->lire) accessforbidden();
|
||||
$accessallowed=1;
|
||||
}
|
||||
elseif ($modulepart == 'ticket')
|
||||
{
|
||||
$result=restrictedArea($user,'ticket',$id,'ticket');
|
||||
@ -177,6 +183,17 @@ elseif ($modulepart == 'expensereport')
|
||||
$dir=$conf->expensereport->dir_output; // By default
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'tax')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
$object = new ChargeSociales($db);
|
||||
if ($id > 0)
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
if ($result <= 0) dol_print_error($db,'Failed to load object');
|
||||
$dir=$conf->tax->dir_output; // By default
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'ticket')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
|
||||
@ -200,7 +217,8 @@ if (empty($backtourl))
|
||||
else if (in_array($modulepart, array('member'))) $backtourl=DOL_URL_ROOT."/adherents/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
||||
else if (in_array($modulepart, array('project'))) $backtourl=DOL_URL_ROOT."/projet/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
||||
else if (in_array($modulepart, array('societe'))) $backtourl=DOL_URL_ROOT."/societe/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
||||
else if (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
||||
else if (in_array($modulepart, array('tax'))) $backtourl=DOL_URL_ROOT."/compta/sociales/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
||||
else if (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
||||
else if (in_array($modulepart, array('user'))) $backtourl=DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
||||
}
|
||||
|
||||
@ -226,6 +244,7 @@ if ($cancel)
|
||||
if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POST["sizex"]) != "") && (isset($_POST["sizey"]) != ""))
|
||||
{
|
||||
$fullpath=$dir."/".$original_file;
|
||||
|
||||
$result=dol_imageResizeOrCrop($fullpath,0,$_POST['sizex'],$_POST['sizey']);
|
||||
|
||||
if ($result == $fullpath)
|
||||
@ -294,6 +313,8 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS
|
||||
if ($action == 'confirm_crop')
|
||||
{
|
||||
$fullpath=$dir."/".$original_file;
|
||||
|
||||
//var_dump($_POST['w'].'x'.$_POST['h'].'-'.$_POST['x'].'x'.$_POST['y']);exit;
|
||||
$result=dol_imageResizeOrCrop($fullpath,1,$_POST['w'],$_POST['h'],$_POST['x'],$_POST['y']);
|
||||
|
||||
if ($result == $fullpath)
|
||||
@ -419,9 +440,9 @@ if (! empty($conf->use_javascript_ajax))
|
||||
// If image is too large, we use another scale.
|
||||
if (! empty($_SESSION['dol_screenwidth']) && ($widthforcrop > round($_SESSION['dol_screenwidth']/2)))
|
||||
{
|
||||
$widthforcrop=round($_SESSION['dol_screenwidth']/2);
|
||||
$ratioforcrop=2;
|
||||
$widthforcrop=round($_SESSION['dol_screenwidth'] / $ratioforcrop);
|
||||
$refsizeforcrop='screenwidth';
|
||||
$ratioforcrop=1;
|
||||
}
|
||||
|
||||
print '<!-- Form to crop -->'."\n";
|
||||
@ -448,7 +469,7 @@ if (! empty($conf->use_javascript_ajax))
|
||||
<input type="hidden" id="action" name="action" value="confirm_crop" />
|
||||
<input type="hidden" id="product" name="product" value="'.dol_escape_htmltag($id).'" />
|
||||
<input type="hidden" id="refsizeforcrop" name="refsizeforcrop" value="'.$refsizeforcrop.'" />
|
||||
<input type="hidden" id="ratioforcrop" name="ratioforcrop" value="'.$ratioforcrop.'" />
|
||||
<input type="hidden" id="ratioforcrop" name="ratioforcrop" value="'.$ratioforcrop.'" /><!-- field used by core/lib/lib_photoresize.js -->
|
||||
<input type="hidden" name="modulepart" value="'.dol_escape_htmltag($modulepart).'" />
|
||||
<input type="hidden" name="id" value="'.dol_escape_htmltag($id).'" />
|
||||
<br>
|
||||
|
||||
@ -18,12 +18,17 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey];
|
||||
|
||||
$mode_search=0;
|
||||
if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int
|
||||
if (in_array($typ, array('chkbxlst','checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0') && (! in_array($typ, array('link')) || $crit != '-1'))
|
||||
if ($crit != '' && in_array($typ, array('date', 'datetime', 'timestamp')))
|
||||
{
|
||||
$sql .= " AND ef.".$tmpkey." = '".$db->idate($crit)."'";
|
||||
}
|
||||
elseif ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0') && (! in_array($typ, array('link')) || $crit != '-1'))
|
||||
{
|
||||
$mode_search=0;
|
||||
if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int
|
||||
if (in_array($typ, array('chkbxlst','checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text
|
||||
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search);
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ if ($disablenofollow) echo '</a>';
|
||||
|
||||
<!-- Login -->
|
||||
<div class="trinputlogin">
|
||||
<div class="tagtd nowrap center valignmiddle tdinputlogin">
|
||||
<div class="tagtd nowraponall center valignmiddle tdinputlogin">
|
||||
<?php if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?><label for="username" class="hidden"><?php echo $langs->trans("Login"); ?></label><?php } ?>
|
||||
<!-- <span class="span-icon-user">-->
|
||||
<span class="fa fa-user">
|
||||
@ -138,7 +138,7 @@ if ($disablenofollow) echo '</a>';
|
||||
|
||||
<!-- Password -->
|
||||
<div class="trinputlogin">
|
||||
<div class="tagtd nowrap center valignmiddle tdinputlogin">
|
||||
<div class="tagtd nowraponall center valignmiddle tdinputlogin">
|
||||
<?php if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?><label for="password" class="hidden"><?php echo $langs->trans("Password"); ?></label><?php } ?>
|
||||
<!--<span class="span-icon-password">-->
|
||||
<span class="fa fa-key">
|
||||
@ -172,7 +172,7 @@ if ($captcha) {
|
||||
?>
|
||||
<!-- Captcha -->
|
||||
<div class="trinputlogin">
|
||||
<div class="tagtd nowrap none center valignmiddle tdinputlogin">
|
||||
<div class="tagtd nowraponall none center valignmiddle tdinputlogin">
|
||||
|
||||
<table class="login_table_securitycode centpercent">
|
||||
<tr class="valignmiddle">
|
||||
|
||||
@ -101,7 +101,7 @@ if ($disablenofollow) echo '</a>';
|
||||
|
||||
<!-- Login -->
|
||||
<div class="trinputlogin">
|
||||
<div class="tagtd nowrap center valignmiddle tdinputlogin">
|
||||
<div class="tagtd nowraponall center valignmiddle tdinputlogin">
|
||||
<!-- <span class="span-icon-user">-->
|
||||
<span class="fa fa-user">
|
||||
</span>
|
||||
@ -135,7 +135,7 @@ if (! empty($morelogincontent)) {
|
||||
?>
|
||||
<!-- Captcha -->
|
||||
<div class="trinputlogin">
|
||||
<div class="tdinputlogin nowrap none center valignmiddle tdinputlogin">
|
||||
<div class="tdinputlogin nowraponall none center valignmiddle tdinputlogin">
|
||||
|
||||
<table class="login_table_securitycode centpercent">
|
||||
<tr class="valignmiddle">
|
||||
|
||||
@ -62,15 +62,16 @@ $securitykey = GETPOST('securitykey','alpha');
|
||||
|
||||
$diroutputmassaction=$conf->cronjob->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
$object = new Cronjob($db);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('cronjoblist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('cronjob');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
$object = new Cronjob($db);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -155,7 +155,7 @@ class EmailCollector extends CommonObject
|
||||
public $lastresult;
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
public $rules;
|
||||
public $filters;
|
||||
public $actions;
|
||||
|
||||
|
||||
@ -523,28 +523,28 @@ class EmailCollector extends CommonObject
|
||||
}
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status];
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
}
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status];
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
}
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
}
|
||||
|
||||
@ -613,15 +613,15 @@ class EmailCollector extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch rules
|
||||
* Fetch filters
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch_rules()
|
||||
public function fetchFilters()
|
||||
{
|
||||
$this->rules = array();
|
||||
$this->filters = array();
|
||||
|
||||
$sql='SELECT type, rulevalue FROM '.MAIN_DB_PREFIX.'emailcollector_emailcollectorfilter WHERE status = 1 AND fk_emailcollector = '.$this->id;
|
||||
$sql='SELECT rowid, type, rulevalue, status FROM '.MAIN_DB_PREFIX.'emailcollector_emailcollectorfilter WHERE fk_emailcollector = '.$this->id;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -631,10 +631,12 @@ class EmailCollector extends CommonObject
|
||||
while($i < $num)
|
||||
{
|
||||
$obj=$this->db->fetch_object($resql);
|
||||
$this->rules[]=array('type'=>$obj->type, 'rulevalue'=>$obj->rulevalue);
|
||||
$this->filters[$obj->rowid]=array('id'=>$obj->rowid, 'type'=>$obj->type, 'rulevalue'=>$obj->rulevalue, 'status'=>$obj->status);
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -644,11 +646,11 @@ class EmailCollector extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch_actions()
|
||||
public function fetchActions()
|
||||
{
|
||||
$this->actions = array();
|
||||
|
||||
$sql='SELECT type, actionparam FROM '.MAIN_DB_PREFIX.'emailcollector_emailcollectoraction WHERE status = 1 AND fk_emailcollector = '.$this->id;
|
||||
$sql='SELECT rowid, type, actionparam, status FROM '.MAIN_DB_PREFIX.'emailcollector_emailcollectoraction WHERE fk_emailcollector = '.$this->id;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -658,10 +660,12 @@ class EmailCollector extends CommonObject
|
||||
while($i < $num)
|
||||
{
|
||||
$obj=$this->db->fetch_object($resql);
|
||||
$this->rules[]=array('type'=>$obj->type, 'actionparam'=>$obj->actionparam);
|
||||
$this->actions[$obj->rowid]=array('id'=>$obj->rowid, 'type'=>$obj->type, 'actionparam'=>$obj->actionparam, 'status'=>$obj->status);
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
}
|
||||
|
||||
|
||||
@ -709,8 +713,8 @@ class EmailCollector extends CommonObject
|
||||
return -2;
|
||||
}
|
||||
|
||||
$this->fetch_rules();
|
||||
$this->fetch_actions();
|
||||
$this->fetchFilters();
|
||||
$this->fetchActions();
|
||||
|
||||
$sourcedir = $this->source_directory;
|
||||
$targetdir = ($this->target_directory ? $server.$this->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag'
|
||||
@ -735,16 +739,18 @@ class EmailCollector extends CommonObject
|
||||
|
||||
//$search='ALL';
|
||||
$search='UNDELETED';
|
||||
foreach($this->rules as $key => $rulevalue)
|
||||
foreach($this->filters as $rule)
|
||||
{
|
||||
if ($key == 'to') $search=($search?' ':'').'TO "'.str_replace('"', '', $rulevalue).'"';
|
||||
if ($key == 'bcc') $search=($search?' ':'').'BCC';
|
||||
if ($key == 'cc') $search=($search?' ':'').'CC';
|
||||
if ($key == 'from') $search=($search?' ':'').'FROM "'.str_replace('"', '', $rulevalue).'"';
|
||||
if ($key == 'subject') $search=($search?' ':'').'SUBJECT "'.str_replace('"', '', $rulevalue).'"';
|
||||
if ($key == 'body') $search=($search?' ':'').'BODY "'.str_replace('"', '', $rulevalue).'"';
|
||||
if ($key == 'seen') $search=($search?' ':'').'SEEN';
|
||||
if ($key == 'unseen') $search=($search?' ':'').'UNSEEN';
|
||||
if (empty($rule['status'])) continue;
|
||||
|
||||
if ($rule['key'] == 'to') $search=($search?' ':'').'TO "'.str_replace('"', '', $rule['rulevalue']).'"';
|
||||
if ($rule['key'] == 'bcc') $search=($search?' ':'').'BCC';
|
||||
if ($rule['key'] == 'cc') $search=($search?' ':'').'CC';
|
||||
if ($rule['key'] == 'from') $search=($search?' ':'').'FROM "'.str_replace('"', '', $rule['rulevalue']).'"';
|
||||
if ($rule['key'] == 'subject') $search=($search?' ':'').'SUBJECT "'.str_replace('"', '', $rule['rulevalue']).'"';
|
||||
if ($rule['key'] == 'body') $search=($search?' ':'').'BODY "'.str_replace('"', '', $rule['rulevalue']).'"';
|
||||
if ($rule['key'] == 'seen') $search=($search?' ':'').'SEEN';
|
||||
if ($rule['key'] == 'unseen') $search=($search?' ':'').'UNSEEN';
|
||||
}
|
||||
|
||||
if (empty($targetdir)) // Use last date as filter if there is no targetdir defined.
|
||||
@ -773,7 +779,7 @@ class EmailCollector extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$overview = imap_fetch_overview($connection, $imapemail, 0);
|
||||
$header = imap_fetchheader($connection ,$imapemail, 0);
|
||||
$header = imap_fetchheader($connection, $imapemail, 0);
|
||||
$message = imap_body($connection, $imapemail, 0);
|
||||
// imap_fetchstructure($connection, $imapemail, 0);
|
||||
// imap_fetchbody($connection, $imapemail, 1) may be text/plain, 2 may be text/html
|
||||
@ -783,12 +789,14 @@ class EmailCollector extends CommonObject
|
||||
var_dump($message);
|
||||
*/
|
||||
|
||||
// Record email
|
||||
foreach($this->actions as $actionkey => $actionvalue)
|
||||
// Do operationss
|
||||
foreach($this->actions as $operation)
|
||||
{
|
||||
if ($errorforactions) break;
|
||||
if (empty($operation['status'])) continue;
|
||||
|
||||
// Make Operation
|
||||
|
||||
// Make action
|
||||
|
||||
|
||||
if (! $errorforactions)
|
||||
|
||||
@ -50,7 +50,7 @@ class EmailCollectorAction extends CommonObject
|
||||
/**
|
||||
* @var int Does emailcollectoraction support extrafields ? 0=No, 1=Yes
|
||||
*/
|
||||
public $isextrafieldmanaged = 1;
|
||||
public $isextrafieldmanaged = 0;
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for emailcollectoraction. Must be the part after the 'object_' into object_emailcollectoraction.png
|
||||
@ -181,6 +181,14 @@ class EmailCollectorAction extends CommonObject
|
||||
*/
|
||||
public function create(User $user, $notrigger = false)
|
||||
{
|
||||
global $langs;
|
||||
if (empty($this->type))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->errors[]=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $this->createCommon($user, $notrigger);
|
||||
}
|
||||
|
||||
@ -414,28 +422,28 @@ class EmailCollectorAction extends CommonObject
|
||||
}
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status];
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
}
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status];
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
}
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ class EmailCollectorFilter extends CommonObject
|
||||
/**
|
||||
* @var int Does emailcollectorfilter support extrafields ? 0=No, 1=Yes
|
||||
*/
|
||||
public $isextrafieldmanaged = 1;
|
||||
public $isextrafieldmanaged = 0;
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for emailcollectorfilter. Must be the part after the 'object_' into object_emailcollectorfilter.png
|
||||
@ -152,6 +152,20 @@ class EmailCollectorFilter extends CommonObject
|
||||
*/
|
||||
public function create(User $user, $notrigger = false)
|
||||
{
|
||||
global $langs;
|
||||
if (empty($this->type))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->errors[]=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
|
||||
return -1;
|
||||
}
|
||||
if (empty($this->rulevalue))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->errors[]=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("RuleValue"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $this->createCommon($user, $notrigger);
|
||||
}
|
||||
|
||||
@ -385,28 +399,28 @@ class EmailCollectorFilter extends CommonObject
|
||||
}
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status];
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
}
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status];
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
}
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -69,13 +69,15 @@ $pagenext = $page + 1;
|
||||
|
||||
$viewstatut=GETPOST('viewstatut');
|
||||
|
||||
$object = new Expedition($db);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('shipmentlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('expedition');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -90,7 +90,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('expensereport');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
||||
@ -152,7 +152,7 @@ if ($action == 'add') {
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'createfrommodel') {
|
||||
$newinter = new fichinter($db);
|
||||
$newinter = new Fichinter($db);
|
||||
|
||||
// on récupère les enregistrements
|
||||
$object->fetch($id);
|
||||
@ -176,7 +176,7 @@ if ($action == 'add') {
|
||||
// on créer un nouvelle intervention
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($newinter->table_element);
|
||||
$array_options = $extrafields->getOptionalsFromPost($extralabels);
|
||||
$array_options = $extrafields->getOptionalsFromPost($newinter->table_element);
|
||||
$newinter->array_options = $array_options;
|
||||
|
||||
$newfichinterid = $newinter->create($user);
|
||||
|
||||
@ -258,7 +258,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$array_options = $extrafields->getOptionalsFromPost($extralabels);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element);
|
||||
|
||||
$object->array_options = $array_options;
|
||||
|
||||
@ -406,7 +406,7 @@ if (empty($reshook))
|
||||
{
|
||||
// Extrafields
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$array_options = $extrafields->getOptionalsFromPost($extralabels);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element);
|
||||
|
||||
$object->array_options = $array_options;
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('fichinter');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -113,7 +113,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('commande_fournisseur');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -130,7 +130,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('facture_fourn');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -89,7 +89,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('paymentsupplier');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost('paymentsupplier','','search_');
|
||||
|
||||
$arrayfields=array();
|
||||
|
||||
@ -570,25 +570,25 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
{
|
||||
print '<td align="center"><b>!!!</b></td>';
|
||||
}
|
||||
|
||||
|
||||
// Date Max Payment
|
||||
if ($objp->dlr > 0 )
|
||||
{
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->dlr), 'day');
|
||||
|
||||
|
||||
if ($invoice->hasDelay())
|
||||
{
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><b>--</b></td>';
|
||||
}
|
||||
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
|
||||
@ -78,7 +78,7 @@ $diroutputmassaction=$conf->holiday->dir_output . '/temp/massgeneration/'.$user-
|
||||
$hookmanager->initHooks(array('holidaylist')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('holiday');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (! $sortfield) $sortfield="cp.rowid";
|
||||
|
||||
@ -206,6 +206,9 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD INDEX idx_emailcollector
|
||||
ALTER TABLE llx_emailcollector_emailcollectoraction ADD CONSTRAINT fk_emailcollectoraction_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid);
|
||||
|
||||
|
||||
ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue);
|
||||
ALTER TABLE llx_emailcollector_emailcollectoraction ADD UNIQUE INDEX uk_emailcollector_emailcollectoraction (fk_emailcollector, type);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -19,3 +19,4 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD INDEX idx_emailcollector
|
||||
ALTER TABLE llx_emailcollector_emailcollectoraction ADD CONSTRAINT fk_emailcollectoraction_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid);
|
||||
-- END MODULEBUILDER INDEXES
|
||||
|
||||
ALTER TABLE llx_emailcollector_emailcollectoraction ADD UNIQUE INDEX uk_emailcollector_emailcollectoraction (fk_emailcollector, type);
|
||||
|
||||
@ -19,3 +19,5 @@ ALTER TABLE llx_emailcollector_emailcollectorfilter ADD INDEX idx_emailcollector
|
||||
ALTER TABLE llx_emailcollector_emailcollectorfilter ADD CONSTRAINT fk_emailcollectorfilter_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid);
|
||||
-- END MODULEBUILDER INDEXES
|
||||
|
||||
ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue);
|
||||
|
||||
|
||||
@ -1815,10 +1815,13 @@ EnableFeatureFor=Enable features for <strong>%s</strong>
|
||||
VATIsUsedIsOff=Note: The option to use sales Tax or VAT has been set to <strong>Off</strong> in the menu %s - %s, so Sale tax or Vat used will always be 0 for sales.
|
||||
SwapSenderAndRecipientOnPDF=Swap sender and recipient address on PDF
|
||||
FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields only
|
||||
EmailCollector=Email collector
|
||||
EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some record automatically (like leads).
|
||||
NewEmailCollector=New Email Collector
|
||||
EMailHost=Host of email IMAP server
|
||||
MailboxSourceDirectory=Mailbox source directory
|
||||
MailboxTargetDirectory=Mailbox target directory
|
||||
EmailcollectorOperations=Operations done by collector
|
||||
CollectNow=Collect now
|
||||
DateLastResult=Date last collect
|
||||
LastResult=Last result
|
||||
@ -1827,6 +1830,8 @@ EmailCollectorConfirmCollect=Do you want to run the collect for this collector n
|
||||
NoNewEmailToProcess=No new email to process
|
||||
NothingProcessed=Nothing done
|
||||
XEmailsDoneYActionsDone=%s emails analyzed, %s record/actions done by collector
|
||||
RecordEvent=Record event
|
||||
CreateLeadAndThirdParty=Create lead (and thirdparty if necessary)
|
||||
##### Resource ####
|
||||
ResourceSetup=Configuration du module Resource
|
||||
UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).
|
||||
|
||||
@ -635,6 +635,8 @@ SendMail=Send email
|
||||
EMail=E-mail
|
||||
NoEMail=No email
|
||||
Email=Email
|
||||
AlreadyRead=Alreay read
|
||||
NotRead=Not read
|
||||
NoMobilePhone=No mobile phone
|
||||
Owner=Owner
|
||||
FollowingConstantsWillBeSubstituted=The following constants will be replaced with the corresponding value.
|
||||
|
||||
@ -264,7 +264,7 @@ if ($action == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Label").'</td><td><input name="label" size="40" maxlength="255" value="'.dol_escape_htmltag(GETPOST('label')).'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Label").'</td><td><input name="label" class="minwidth300" maxlength="255" value="'.dol_escape_htmltag(GETPOST('label')).'" autofocus="autofocus"></td></tr>';
|
||||
|
||||
// Bank account
|
||||
if (! empty($conf->banque->enabled))
|
||||
@ -434,7 +434,7 @@ if ($id > 0)
|
||||
|
||||
// Loan card
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/loan/index.php">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/loan/list.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref loan
|
||||
|
||||
@ -124,7 +124,7 @@ if ($object->id)
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/loan/index.php">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/loan/list.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ if (! empty($conf->projet->enabled)) {
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/loan/index.php">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/loan/list.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/loan/index.php
|
||||
* \file htdocs/loan/list.php
|
||||
* \ingroup loan
|
||||
* \brief Page to list all loans
|
||||
*/
|
||||
@ -113,7 +113,7 @@ if ($id > 0)
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/loan/index.php">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/loan/list.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
header("Location: ".DOL_URL_ROOT."/loan/index.php");
|
||||
header("Location: ".DOL_URL_ROOT."/loan/list.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -357,7 +357,6 @@ class MyObject extends CommonObject
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result = '';
|
||||
$companylink = '';
|
||||
|
||||
$label = '<u>' . $langs->trans("MyObject") . '</u>';
|
||||
$label.= '<br>';
|
||||
@ -453,28 +452,28 @@ class MyObject extends CommonObject
|
||||
}
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status];
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
}
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status];
|
||||
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
||||
}
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5');
|
||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ $diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user
|
||||
$hookmanager->initHooks(array('myobjectcard','globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all=trim(GETPOST("search_all",'alpha'));
|
||||
|
||||
@ -93,8 +93,8 @@ $extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('myobjectlist')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('myobject');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('myobject'); // Load $extrafields->attributes['myobject']
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||
|
||||
@ -53,7 +53,7 @@ $diroutputmassaction=$conf->stock->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('inventorycard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('inventory');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost('inventory','','search_');
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all=trim(GETPOST("search_all",'alpha'));
|
||||
|
||||
@ -59,7 +59,7 @@ $diroutputmassaction=$conf->inventory->dir_output . '/temp/massgeneration/'.$use
|
||||
$hookmanager->initHooks(array('inventorylist')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('inventory');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||
|
||||
@ -99,7 +99,7 @@ $form=new Form($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('product');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
if (empty($action)) $action='list';
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ $formfile = new FormFile($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('movement');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
$arrayfields=array(
|
||||
'm.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 All-3kcis <contact@all-3kcis.fr>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
@ -317,7 +316,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/product/stock/productlot_list.php' . '">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/product/stock/productlot_list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$shownav = 1;
|
||||
if ($user->societe_id && ! in_array('batch', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||
|
||||
@ -131,7 +131,7 @@ if ($object->id)
|
||||
}
|
||||
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/product/stock/productlot_list.php' . '">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/product/stock/productlot_list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$shownav = 1;
|
||||
if ($user->societe_id && ! in_array('batch', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||
|
||||
@ -79,7 +79,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('product_lot');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -416,7 +416,7 @@ print '<div class="colorback float valignmiddle">';
|
||||
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
|
||||
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
|
||||
print '<div class="taskiddiv inline-block">';
|
||||
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1);
|
||||
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1, 0, 0, '', '', 'all', $usertoprocess);
|
||||
print '</div>';
|
||||
print ' ';
|
||||
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');
|
||||
|
||||
@ -418,7 +418,7 @@ print '<div class="colorback float valignmiddle">';
|
||||
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
|
||||
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
|
||||
print '<div class="taskiddiv inline-block">';
|
||||
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1);
|
||||
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1, 0, 0, '', '', 'all', $usertoprocess);
|
||||
print '</div>';
|
||||
print ' ';
|
||||
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');
|
||||
|
||||
@ -105,7 +105,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('projet');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -79,7 +79,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('projet_task');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
|
||||
@ -182,7 +182,7 @@ if ($action == "view_ticketlist")
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('ticket');
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_');
|
||||
$search_array_options = $extrafields->getOptionalsFromPost('ticket', '', 'search_');
|
||||
|
||||
$filter = array();
|
||||
$param = '';
|
||||
|
||||
@ -250,7 +250,7 @@ if ($action == 'create' || $object->fetch($id) > 0)
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("ResourceFormLabel_ref").'</td>';
|
||||
print '<td><input class="minwidth200" name="ref" value="'.($ref ? $ref : $object->ref).'"></td></tr>';
|
||||
print '<td><input class="minwidth200" name="ref" value="'.($ref ? $ref : $object->ref).'" autofocus="autofocus"></td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans("ResourceType").'</td>';
|
||||
|
||||
@ -50,7 +50,7 @@ $extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||
$search_ref=GETPOST("search_ref");
|
||||
$search_type=GETPOST("search_type");
|
||||
|
||||
|
||||
@ -417,8 +417,8 @@ if (empty($reshook))
|
||||
$object->idprof5 = trim(GETPOST('idprof5', 'alpha'));
|
||||
$object->idprof6 = trim(GETPOST('idprof6', 'alpha'));
|
||||
$object->prefix_comm = GETPOST('prefix_comm', 'alpha');
|
||||
$object->code_client = GETPOST('customer_code', 'alpha');
|
||||
$object->code_fournisseur = GETPOST('supplier_code', 'alpha');
|
||||
$object->code_client = GETPOSTISSET('customer_code')?GETPOST('customer_code', 'alpha'):GETPOST('code_client', 'alpha');
|
||||
$object->code_fournisseur = GETPOSTISSET('supplier_code')?GETPOST('supplier_code', 'alpha'):GETPOST('code_fournisseur', 'alpha');
|
||||
$object->capital = GETPOST('capital', 'alpha');
|
||||
$object->barcode = GETPOST('barcode', 'alpha');
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user