Merge branch 'develop' into dev_EventOrganisation_ProjectCardAndList

This commit is contained in:
Laurent Destailleur 2021-02-19 12:54:38 +01:00 committed by GitHub
commit 70e2d1dbbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
163 changed files with 1288 additions and 829 deletions

View File

@ -72,6 +72,9 @@ FIX: User creation of expense report not visible
FIX: warning when adding a line if $remise_percent is an empty string
FIX: status late on purchase orders
FIX: ODT generation very slow
FIX: amount in summary of report
FIX: vat value when code contains number
FIX: payment term label on PDF
***** ChangeLog for 13.0.0 compared to 12.0.0 *****

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

View File

@ -359,9 +359,9 @@ class AccountancyExport
print length_accountg($line->numero_compte).$separator;
print length_accounta($line->subledger_account).$separator;
print $line->sens.$separator;
print price($line->montant).$separator;
print $line->label_operation.$separator;
print $line->doc_ref;
print price2fec(abs($line->montant)).$separator;
print dol_string_unaccent($line->label_operation).$separator;
print dol_string_unaccent($line->doc_ref);
print $end_line;
}
}

View File

@ -796,7 +796,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$adht = new AdherentType($db);
print load_fiche_titre($langs->trans("NewMember"), '', 'members');
print load_fiche_titre($langs->trans("NewMember"), '', $object->picto);
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';

View File

@ -236,7 +236,7 @@ $form = new Form($db);
llxHeader('', $langs->trans("MembersCards"));
print load_fiche_titre($langs->trans("LinkToGeneratedPages"), '', 'members');
print load_fiche_titre($langs->trans("LinkToGeneratedPages"), '', $adherentstatic->picto);
print '<span class="opacitymedium">'.$langs->trans("LinkToGeneratedPagesDesc").'</span><br>';
print '<br>';

View File

@ -46,7 +46,7 @@ class AdherentType extends CommonObject
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'group';
public $picto = 'members';
/**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

View File

@ -52,7 +52,7 @@ $staticmember = new Adherent($db);
$statictype = new AdherentType($db);
$subscriptionstatic = new Subscription($db);
print load_fiche_titre($langs->trans("MembersArea"), '', 'members');
print load_fiche_titre($langs->trans("MembersArea"), '', 'member');
$Adherents = array();
$AdherentsAValider = array();

View File

@ -425,7 +425,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information";
$modelmail = "member";
@ -443,8 +443,7 @@ $moreforfilter = '';
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('Categories').': ';
$moreforfilter .= $formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1);
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1);
$moreforfilter .= '</div>';
}
$parameters = array();

View File

@ -57,7 +57,7 @@ llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, arra
$title = $langs->trans("MembersStatisticsByProperties");
print load_fiche_titre($title, '', 'object_group');
print load_fiche_titre($title, '', $memberstatic->picto);
dol_mkdir($dir);
@ -128,7 +128,7 @@ if ($resql) {
$head = member_stats_prepare_head($adh);
print dol_get_fiche_head($head, 'statsbyproperties', $langs->trans("Statistics"), -1, 'user');
print dol_get_fiche_head($head, 'statsbyproperties', '', -1, '');
// Print title

View File

@ -25,6 +25,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$graphwidth = DolGraph::getDefaultGraphSizeForStats('width', 700);
$mapratio = 0.5;
@ -52,6 +53,8 @@ $langs->loadLangs(array("companies", "members", "banks"));
* View
*/
$memberstatic = new Adherent($db);
$arrayjs = array('https://www.google.com/jsapi');
if (!empty($conf->dol_use_jmobile)) $arrayjs = array();
@ -63,7 +66,7 @@ if ($mode == 'memberbyregion') $title = $langs->trans("MembersStatisticsByRegion
llxHeader('', $title, '', '', 0, 0, $arrayjs);
print load_fiche_titre($title, '', 'object_group');
print load_fiche_titre($title, '', $memberstatic->picto);
dol_mkdir($dir);
@ -196,7 +199,7 @@ if ($mode) {
$head = member_stats_prepare_head($adh);
print dol_get_fiche_head($head, $tab, $langs->trans("Statistics"), -1, 'user');
print dol_get_fiche_head($head, $tab, '', -1, '');
// Print title
@ -268,7 +271,6 @@ if (count($arrayjs) && $mode == 'memberbycountry') {
// print the div tag that will contain the map
print '<div class="center" id="'.$mode.'"></div>'."\n";
print '<br>';
}
if ($mode) {

View File

@ -24,6 +24,7 @@
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
@ -53,12 +54,13 @@ $langs->loadLangs(array("companies", "members"));
* View
*/
$memberstatic = new Adherent($db);
$form = new Form($db);
$title = $langs->trans("SubscriptionsStatistics");
llxHeader('', $title);
print load_fiche_titre($title, '', 'members');
print load_fiche_titre($title, '', $memberstatic->picto);
$dir = $conf->adherent->dir_temp;
@ -133,7 +135,7 @@ if (!$mesg) {
$head = member_stats_prepare_head($adh);
print dol_get_fiche_head($head, 'statssubscription', $langs->trans("Statistics"), -1, 'user');
print dol_get_fiche_head($head, 'statssubscription', '', -1, '');
print '<div class="fichecenter"><div class="fichethirdleft">';

View File

@ -153,8 +153,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->adherent-
$form = new Form($db);
llxHeader('', $langs->trans("SubscriptionCard"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
$help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('', $langs->trans("SubscriptionCard"), $help_url);
dol_htmloutput_errors($errmsg);

View File

@ -209,7 +209,8 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
exit;
}
llxHeader('', $langs->trans("ListOfSubscriptions"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
$help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('', $langs->trans("ListOfSubscriptions"), $help_url);
$i = 0;
@ -253,7 +254,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information";
$modelmail = "subscription";

View File

@ -203,7 +203,8 @@ if ($action == 'confirm_delete' && $user->rights->adherent->configurer) {
$form = new Form($db);
$formproduct = new FormProduct($db);
llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
$help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('', $langs->trans("MembersTypeSetup"), $help_url);
// List of members type
if (!$rowid && $action != 'create' && $action != 'edit') {

View File

@ -319,7 +319,7 @@ print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
print '<td>'.$langs->trans("SourceFile").'</td>';
print '<td width="160" class="center">'.$langs->trans("ActivateOn").'</td>';
print '<td width="160" class="center">'.$langs->trans("ActivatableOn").'</td>';
print "</tr>\n";
foreach ($boxtoadd as $box) {
@ -377,7 +377,7 @@ print '<table class="tagtable liste">'."\n";
print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
print '<td class="center" width="160">'.$langs->trans("ActiveOn").'</td>';
print '<td class="center" width="160">'.$langs->trans("ActivatableOn").'</td>';
print '<td class="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>';
print '<td class="center" width="80">'.$langs->trans("Disable").'</td>';
print '</tr>'."\n";

View File

@ -73,7 +73,7 @@ print '<br>';
$head = ecm_admin_prepare_head();
print dol_get_fiche_head($head, 'ecm', $langs->trans("ECM"), -1, 'ecm');
print dol_get_fiche_head($head, 'ecm', '', -1, '');
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';

View File

@ -80,7 +80,7 @@ print "<br>\n";
$head = ecm_admin_prepare_head();
print dol_get_fiche_head($head, 'attributes_ecm_directories', $langs->trans("ECM"), -1, 'ecm');
print dol_get_fiche_head($head, 'attributes_ecm_directories', '', -1, '');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -80,7 +80,7 @@ print "<br>\n";
$head = ecm_admin_prepare_head();
print dol_get_fiche_head($head, 'attributes_ecm_files', $langs->trans("ECM"), -1, 'ecm');
print dol_get_fiche_head($head, 'attributes_ecm_files', '', -1, '');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -890,7 +890,7 @@ if ($resql)
$class = "tddict";
$valuetoshow = $obj->{$fieldlist[$field]};
if ($value == 'label' || $value == 'topic') {
if ($langs->trans($valuetoshow)!=$valuetoshow) {
if ($langs->trans($valuetoshow) != $valuetoshow) {
$valuetoshow = $langs->trans($valuetoshow);
}
$valuetoshow = dol_escape_htmltag($valuetoshow);

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('errors', 'admin', 'modulebuilder'));
$langs->loadLangs(array('errors', 'admin', 'modulebuilder', 'exports'));
$mode = GETPOST('mode', 'alpha');
$action = GETPOST('action', 'aZ09');

View File

@ -525,7 +525,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
$moreforfilter .= '<div class="divsearchfield paddingtop">';
$moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacitymedium"').'<input type="text" id="search_keyword" name="search_keyword" class="maxwidth100" value="'.dol_escape_htmltag($search_keyword).'" placeholder="'.dol_escape_htmltag($langs->trans('Keyword')).'">';
$moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacitymedium"').'<input type="text" id="search_keyword" name="search_keyword" class="maxwidth125" value="'.dol_escape_htmltag($search_keyword).'" placeholder="'.dol_escape_htmltag($langs->trans('Keyword')).'">';
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield paddingtop">';
$moreforfilter .= $form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), $langs->trans('Origin'), 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1);
@ -1073,9 +1073,9 @@ if ($mode == 'deploy') {
} else {
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
print '<b>'.$langs->trans("StepNb", 1).'</b>: ';
print $langs->trans("FindPackageFromWebSite", $fullurl).'<br>';
print str_replace('{s1}', $fullurl, $langs->trans("FindPackageFromWebSite", '{s1}')).'<br>';
print '<b>'.$langs->trans("StepNb", 2).'</b>: ';
print $langs->trans("DownloadPackageFromWebSite", $fullurl).'<br>';
print str_replace('{s1}', $fullurl, $langs->trans("DownloadPackageFromWebSite", '{s1}')).'<br>';
print '<b>'.$langs->trans("StepNb", 3).'</b>: ';
}

View File

@ -326,7 +326,8 @@ print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
//if (! empty($conf->global->MAIN_MULTILANGS))
//{
print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0), 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
$selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0);
print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
//} else {
// print '<span class="opacitymedium">'.$langs->trans("MultiLangNotEnabled").'</span>';
//}

View File

@ -64,9 +64,10 @@ if ($action == 'getlastversion')
$form = new Form($db);
$help_url = '';
$title = $langs->trans("InfoDolibarr");
llxHeader('', $title);
llxHeader('', $title, $help_url);
print load_fiche_titre($title, '', 'title_setup');

View File

@ -110,7 +110,12 @@ if ($action == 'update') {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
// Set boolean (on/off) constants
elseif (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) {
if (!dolibarr_set_const($db, $reg[2], ($reg[1] === 'set' ? '1' : '0'), 'chaine', 0, '', $conf->entity) > 0) {
dol_print_error($db);
}
}
/*
@ -248,11 +253,26 @@ print "<br>\n";
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="button">';
print '<br/><br/>';
print '</div>';
print '</form>';
// Options
echo '<div>';
echo '<table class="noborder centpercent">';
echo '<thead>';
echo '<tr class="liste_titre"><th>' . $langs->trans('Parameter') . '</th><th>' . $langs->trans('Value') . '</th></tr>';
echo '</thead>';
echo '<tbody>';
$key = 'CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT';
echo '<tr><td>', $langs->trans($key), '</td><td>', ajax_constantonoff($key), '</td></tr>';
echo '</tbody>';
echo '</table>';
echo '</div>';
if (!empty($conf->accounting->enabled))

View File

@ -166,7 +166,8 @@ if ($action == 'confirm_purge' && $confirm == 'yes' && $user->admin)
* View
*/
llxHeader('', $langs->trans("Audit"));
$title = $langs->trans("Audit");
llxHeader('', $title);
$form = new Form($db);

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2021 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
*
* This program is free software; you can redistribute it and/or modify
@ -70,7 +70,7 @@ $workflowcodes = array(
'picto'=>'bill'
),
'separator1'=>array('family'=>'separator', 'position'=>25),
'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>''),
// Automatic classification of proposal
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
@ -183,6 +183,7 @@ foreach ($workflowcodes as $key => $params) {
if ($params['family'] == 'separator') {
print '</table>';
print '<br>';
print '<table class="noborder centpercent">';
continue;

View File

@ -773,7 +773,6 @@ class BlockedLog
*/
public function create($user, $forcesignature = '')
{
global $conf, $langs, $hookmanager;
$langs->load('blockedlog');
@ -814,6 +813,8 @@ class BlockedLog
$keyforsignature = $this->buildKeyForSignature();
include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
$this->signature_line = dol_hash($keyforsignature, '5'); // Not really usefull
$this->signature = dol_hash($previoushash.$keyforsignature, '5');
if ($forcesignature) $this->signature = $forcesignature;

View File

@ -730,8 +730,8 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate')
{
$error = 0;
$shour = dol_print_date($object->datep, "%H");
$smin = dol_print_date($object->datep, "%M");
$shour = dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user.
$smin = dol_print_date($object->datep, "%M", 'tzuserrel');
$newdate = GETPOST('newdate', 'alpha');
if (empty($newdate) || strpos($newdate, 'dayevent_') != 0)
@ -740,7 +740,9 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate')
exit;
}
$datep = dol_mktime($shour, $smin, 0, substr($newdate, 13, 2), substr($newdate, 15, 2), substr($newdate, 9, 4));
$datep = dol_mktime($shour, $smin, 0, substr($newdate, 13, 2), substr($newdate, 15, 2), substr($newdate, 9, 4), 'tzuserrel');
//print dol_print_date($datep, 'dayhour');exit;
if ($datep != $object->datep)
{
if (!empty($object->datef))

View File

@ -85,6 +85,11 @@ class ActionComm extends CommonObject
*/
public $type_id;
/**
* @var string Calendar of event (Type of type of event). 'system'=Default calendar, 'systemauto'=Auto calendar, 'birthdate', 'holiday', 'module'=Calendar specific to a module
*/
public $type;
/**
* @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
*/
@ -95,16 +100,16 @@ class ActionComm extends CommonObject
*/
public $type_label;
/**
* @var string Label into parent table llx_c_actioncomm (used only if option to use type is set)
*/
public $type;
/**
* @var string Color into parent table llx_c_actioncomm (used only if option to use type is set)
*/
public $type_color;
/**
* @var string Picto for type of event (used only if option to use type is set)
*/
public $type_picto;
/**
* @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
*/
@ -1376,7 +1381,7 @@ class ActionComm extends CommonObject
* @param int $maxlength Max number of charaters into label. If negative, use the ref as label.
* @param string $classname Force style class on a link
* @param string $option '' = Link to action, 'birthday'= Link to contact, 'holiday' = Link to leave
* @param int $overwritepicto 1 = Overwrite picto
* @param int $overwritepicto 1 = Overwrite picto with this one
* @param int $notooltip 1 = Disable tooltip
* @param int $save_lastsearch_value -1 = Auto, 0 = No save of lastsearch_values when clicking, 1 = Save lastsearch_values whenclicking
* @return string Chaine avec URL
@ -1426,8 +1431,8 @@ class ActionComm extends CommonObject
if (!empty($this->note_private))
$tooltip .= '<br><b>'.$langs->trans('Note').':</b> '.(dol_textishtml($this->note_private) ? str_replace(array("\r", "\n"), "", $this->note_private) : str_replace(array("\r", "\n"), '<br>', $this->note_private));
$linkclose = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
$linkclose = ' style="background-color:#'.$this->type_color.'"';
//if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
// $linkclose = ' style="background-color:#'.$this->type_color.'"';
if (empty($notooltip))
{
@ -1453,6 +1458,7 @@ class ActionComm extends CommonObject
elseif ($option == 'holiday')
$url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id;
else $url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
if ($option !== 'nolink')
{
// Add param to save lastsearch_values or not
@ -1494,7 +1500,7 @@ class ActionComm extends CommonObject
}
$result .= $linkstart;
if ($withpicto) $result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$libelle), ($overwritepicto ? $overwritepicto : 'action'), ($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto) $result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$libelle), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
$result .= $libelleshort;
$result .= $linkend;
@ -1520,21 +1526,25 @@ class ActionComm extends CommonObject
$imgpicto = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
$color = '';
if ($this->type_color) {
$color = 'style="color: #'.$this->type_color.' !important;"';
}
if ($this->type_picto) {
$imgpicto = img_picto('', $this->type_picto, 'class="paddingright"');
} else {
if ($this->type_code == 'AC_RDV') $imgpicto = img_picto('', 'meeting', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_OTH' && $this->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright');
elseif (!preg_match('/_AUTO/', $this->type_code)) $imgpicto = img_picto('', 'user-cog', '', false, 0, 0, '', 'paddingright');
else $imgpicto = img_picto('', 'cog', '', false, 0, 0, '', 'paddingright');
if ($this->type_code == 'AC_RDV') $imgpicto = img_picto('', 'meeting', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN') $imgpicto = img_picto('', 'object_email', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_OTH' && $this->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type != 'systemauto') $imgpicto = img_picto('', 'user-cog', $color, false, 0, 0, '', 'paddingright');
else $imgpicto = img_picto('', 'cog', $color, false, 0, 0, '', 'paddingright');
}
} else {
// 2 picto: 1 for auto, 1 for manual
if (!preg_match('/_AUTO/', $this->type_code)) $imgpicto = img_picto('', 'user-cog', '', false, 0, 0, '', 'paddingright');
if ($this->type != 'systemauto') $imgpicto = img_picto('', 'user-cog', '', false, 0, 0, '', 'paddingright');
else $imgpicto = img_picto('', 'cog', '', false, 0, 0, '', 'paddingright');
}
return $imgpicto;

View File

@ -142,9 +142,9 @@ class CActionComm
* Return list of event types: array(id=>label) or array(code=>label)
*
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code'
* @param string $idorcode 'id' or 'code' or 'all'
* @param string $excludetype Type to exclude ('system' or 'systemauto')
* @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual"
* @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
* @param string $morefilter Add more SQL filter
* @param int $shortlabel 1=Get short label instead of long label
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
@ -157,6 +157,7 @@ class CActionComm
$repid = array();
$repcode = array();
$repall = array();
$sql = "SELECT id, code, libelle as label, module, type, color, picto";
$sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
@ -166,7 +167,7 @@ class CActionComm
}
if (!empty($excludetype)) $sql .= " AND type <> '".$this->db->escape($excludetype)."'";
if ($morefilter) $sql .= " AND ".$morefilter;
$sql .= " ORDER BY module, position, type";
$sql .= " ORDER BY type, position, module";
dol_syslog(get_class($this)."::liste_array", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -175,6 +176,7 @@ class CActionComm
$nump = $this->db->num_rows($resql);
if ($nump)
{
$idforallfornewmodule = 97;
$i = 0;
while ($i < $nump)
{
@ -200,8 +202,12 @@ class CActionComm
$keyfortrans = '';
$transcode = '';
$code = $obj->code;
if ($onlyautoornot > 0 && $code == 'AC_OTH') $code = 'AC_MANUAL';
if ($onlyautoornot > 0 && $code == 'AC_OTH_AUTO') $code = 'AC_AUTO';
$typecalendar = $obj->type;
if ($onlyautoornot > 0 && $typecalendar == 'system') $code = 'AC_MANUAL';
elseif ($onlyautoornot > 0 && $typecalendar == 'systemauto') $code = 'AC_AUTO';
elseif ($onlyautoornot > 0) $code = 'AC_'.strtoupper($obj->module);
if ($shortlabel)
{
$keyfortrans = "Action".$code.'Short';
@ -213,21 +219,43 @@ class CActionComm
$transcode = $langs->trans($keyfortrans);
}
$label = (($transcode != $keyfortrans) ? $transcode : $langs->trans($obj->label));
if ($onlyautoornot == -1 && !empty($conf->global->AGENDA_USE_EVENT_TYPE) && !preg_match('/auto/i', $code))
if ($onlyautoornot == -1 && !empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
$label = '&nbsp; '.$label;
$repid[-99] = $langs->trans("ActionAC_MANUAL");
$repcode['AC_NON_AUTO'] = $langs->trans("ActionAC_MANUAL");
if ($typecalendar == 'system') {
$label = '&nbsp;&nbsp; '.$label;
$repid[-99] = $langs->trans("ActionAC_MANUAL");
$repcode['AC_NON_AUTO'] = '-- '.$langs->trans("ActionAC_MANUAL");
}
if ($typecalendar == 'systemauto') {
$label = '&nbsp;&nbsp; '.$label;
$repid[-98] = $langs->trans("ActionAC_AUTO");
$repcode['AC_ALL_AUTO'] = '-- '.$langs->trans("ActionAC_AUTO");
}
if ($typecalendar == 'module') {
$label = '&nbsp;&nbsp; '.$label;
if (!isset($repcode['AC_ALL_'.strtoupper($obj->module)])) { // If first time for this module
$idforallfornewmodule--;
}
$repid[$idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($obj->module));
$repcode['AC_ALL_'.strtoupper($obj->module)] = '-- '.$langs->trans("Module").' '.ucfirst($obj->module);
}
}
$repid[$obj->id] = $label;
$repcode[$obj->code] = $label;
if ($onlyautoornot > 0 && preg_match('/^module/', $obj->type) && $obj->module) $repcode[$obj->code] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
$repall[$obj->code] = array('id' => $label, 'label' => $label, 'type' => $typecalendar, 'color' => $obj->color, 'picto' => $obj->picto);
if ($onlyautoornot > 0 && preg_match('/^module/', $obj->type) && $obj->module) {
$repcode[$obj->code] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
$repall[$obj->code]['label'] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
}
}
$i++;
}
}
if ($idorcode == 'id') $this->liste_array = $repid;
if ($idorcode == 'code') $this->liste_array = $repcode;
elseif ($idorcode == 'code') $this->liste_array = $repcode;
else $this->liste_array = $repall;
return $this->liste_array;
} else {
$this->error = $this->db->lasterror();

View File

@ -114,8 +114,7 @@ if ($status == '' && !GETPOSTISSET('search_status')) $status = (empty($conf->glo
$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
$defaultview = (empty($user->conf->AGENDA_DEFAULT_VIEW) ? $defaultview : $user->conf->AGENDA_DEFAULT_VIEW);
if (empty($action) && !GETPOSTISSET('action')) $action = $defaultview;
if ($action == 'default') // When action is default, we want a calendar view and not the list
{
if ($action == 'default') { // When action is default, we want a calendar view and not the list
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
}
if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
@ -346,8 +345,8 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid) $param .= "&search_socid=".urlencode($socid);
if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid > 0) $param .= "&search_socid=".urlencode($socid);
if ($showbirthday) $param .= "&search_showbirthday=1";
if ($pid) $param .= "&search_projectid=".urlencode($pid);
if ($type) $param .= "&search_type=".urlencode($type);
@ -357,32 +356,32 @@ $param .= "&maxprint=".urlencode($maxprint);
// Show navigation bar
if (empty($action) || $action == 'show_month')
{
$nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month.$param."\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month.$param."\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%b %Y");
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&month=".$next_month.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth.$param."\">".$langs->trans("Today")."</a> ";
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&month=".$nowmonth.$param."\">".$langs->trans("Today")."</a> ";
}
$picto = 'calendar';
}
if ($action == 'show_week')
{
$nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\" title=\"".dol_escape_htmltag($langs->trans("Previous"))."\"></i></a> &nbsp;\n";
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\" title=\"".dol_escape_htmltag($langs->trans("Previous"))."\"></i></a> &nbsp;\n";
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("Week")." ".$week;
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\" title=\"".dol_escape_htmltag($langs->trans("Next"))."\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\" title=\"".dol_escape_htmltag($langs->trans("Next"))."\"></i></a>\n";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
}
$picto = 'calendarweek';
}
if ($action == 'show_day')
{
$nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."aaa\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "daytextshort");
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
}
@ -394,6 +393,7 @@ $nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
$nav .= '<button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
// Must be after the nav definition
$paramnodate = $param;
$param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : '');
//print 'x'.$param;
@ -410,6 +410,7 @@ if ($action == 'show_pertype') $tabactive = 'cardpertype';
*/
$paramnoaction = preg_replace('/action=[a-z_]+/', '', $param);
$paramnoactionodate = preg_replace('/action=[a-z_]+/', '', $paramnodate);
$head = calendars_prepare_head($paramnoaction);
@ -422,31 +423,31 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
//print dol_get_fiche_end();
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
@ -486,8 +487,8 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
$s .= "\n".'<!-- Div to calendars selectors -->'."\n";
$s .= '<script type="text/javascript">'."\n";
$s .= 'jQuery(document).ready(function () {'."\n";
$s .= 'jQuery(".check_birthday").click(function() { console.log("Toggle birthday"); jQuery(".family_birthday").toggle(); });'."\n";
$s .= 'jQuery(".family_birthday").toggle();'."\n";
$s .= 'jQuery(".check_birthday").click(function() { console.log("Toggle birthdays"); jQuery(".family_birthday").toggle(); });'."\n";
$s .= 'jQuery(".check_holiday").click(function() { console.log("Toggle holidays"); jQuery(".family_holiday").toggle(); });'."\n";
if ($action == "show_week" || $action == "show_month" || empty($action))
{
// Code to enable drag and drop
@ -509,6 +510,9 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
// Local calendar
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
// Holiday calendar
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_holiday" name="check_holiday" class="check_holiday"><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> &nbsp; </div>';
// External calendars
if (is_array($showextcals) && count($showextcals) > 0)
{
@ -541,6 +545,8 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
{
$s = $hookmanager->resPrint;
}
$s .= "\n".'<!-- End div to calendars selectors -->'."\n";
} else // If javascript off
{
$newparam = $param; // newparam is for birthday links
@ -554,9 +560,12 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
$link .= '</a>';
}
// Load events from database into $eventarray
$eventarray = array();
// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
$sql = 'SELECT ';
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= ' a.id, a.label,';
@ -567,7 +576,7 @@ $sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,';
$sql .= ' a.fk_soc, a.fk_contact, a.fk_project,';
$sql .= ' a.fk_element, a.elementtype,';
$sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color';
$sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color, ca.type as type_type, ca.picto as type_picto';
$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table
@ -685,13 +694,17 @@ if ($resql)
$event->type_code = $obj->type_code;
$event->type_label = $obj->type_label;
$event->type_color = $obj->type_color;
$event->type = $obj->type_type;
$event->type_picto = $obj->type_picto;
$event->libelle = $obj->label; // deprecated
$event->label = $obj->label;
$event->percentage = $obj->percent;
$event->authorid = $obj->fk_user_author; // user id of creator
$event->userownerid = $obj->fk_user_action; // user id of owner
$event->fetch_userassigned(); // This load $event->userassigned
$event->priority = $obj->priority;
$event->fulldayevent = $obj->fulldayevent;
$event->location = $obj->location;
@ -752,6 +765,7 @@ if ($resql)
dol_print_error($db);
}
// BIRTHDATES CALENDAR
// Complete $eventarray with birthdates
if ($showbirthday)
{
@ -778,6 +792,7 @@ if ($showbirthday)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$event = new ActionComm($db);
$event->id = $obj->rowid; // We put contact id in action id for birthdays events
@ -788,28 +803,39 @@ if ($showbirthday)
$datearray = dol_getdate($datebirth, true);
$event->datep = dol_mktime(0, 0, 0, $datearray['mon'], $datearray['mday'], $year, true); // For full day events, date are also GMT but they wont but converted during output
$event->datef = $event->datep;
$event->type_code = 'BIRTHDAY';
$event->type_label = '';
$event->type_color = '';
$event->type = 'birthdate';
$event->type_picto = 'birthdate';
$event->label = $langs->trans("Birthday").' '.dolGetFirstLastname($obj->firstname, $obj->lastname);
$event->percentage = 100;
$event->fulldayevent = 1;
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;
$event->date_start_in_calendar = $db->jdate($event->datep);
$event->date_end_in_calendar = $db->jdate($event->datef);
$event->ponctuel = 0;
// Add an entry in actionarray for each day
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y');
$mois = dol_print_date($daycursor, '%m');
$jour = dol_print_date($daycursor, '%d');
// Add an entry in eventarray for each day
$daycursor = $event->datep;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$loop = true;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
$eventarray[$daykey][] = $event;
/*$loop = true;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
if ($daykey > $event->date_end_in_calendar) $loop = false;
} while ($loop);
*/
$i++;
}
} else {
@ -817,89 +843,85 @@ if ($showbirthday)
}
}
if ($conf->global->AGENDA_SHOW_HOLIDAYS)
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = x.fk_user";
$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
if ($action == 'show_day') {
// Request only leaves for the current selected day
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date wihout time
} elseif ($action == 'show_week') {
// TODO: Add filter to reduce database request
} elseif ($action == 'show_month') {
// TODO: Add filter to reduce database request
}
$resql = $db->query($sql);
if ($resql)
{
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = x.fk_user";
$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
$num = $db->num_rows($resql);
$i = 0;
if ($action == 'show_day')
while ($i < $num)
{
// Request only leaves for the current selected day
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin";
} elseif ($action == 'show_week')
{
// TODO: Add filter to reduce database request
} elseif ($action == 'show_month')
{
// TODO: Add filter to reduce database request
}
$obj = $db->fetch_object($resql);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$event = new ActionComm($db);
while ($i < $num)
// Need the id of the leave object for link to it
$event->id = $obj->rowid;
$event->ref = $event->id;
$event->type_code = 'HOLIDAY';
$event->type_label = '';
$event->type_color = '';
$event->type = 'holiday';
$event->type_picto = 'holiday';
$event->datep = $db->jdate($obj->date_start);
$event->datef = $db->jdate($obj->date_end);
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;
if ($obj->status == 3)
{
$obj = $db->fetch_object($resql);
$dateStartArray = dol_getdate(dol_stringtotime($obj->date_start, 1), true);
$dateEndArray = dol_getdate(dol_stringtotime($obj->date_end, 1), true);
$event = new ActionComm($db);
// Need the id of the leave object for link to it
$event->id = $obj->rowid;
$event->ref = $event->id;
$event->type_code = 'HOLIDAY';
$event->datep = dol_mktime(0, 0, 0, $dateStartArray['mon'], $dateStartArray['mday'], $dateStartArray['year'], true);
$event->datef = dol_mktime(0, 0, 0, $dateEndArray['mon'], $dateEndArray['mday'], $dateEndArray['year'], true);
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;
if ($obj->status == 3)
{
// Show no symbol for leave with state "leave approved"
$event->percentage = -1;
} elseif ($obj->status == 2)
{
// Show TO-DO symbol for leave with state "leave wait for approval"
$event->percentage = 0;
}
if ($obj->halfday == 1)
{
$event->label = $obj->lastname.' ('.$langs->trans("Morning").')';
} elseif ($obj->halfday == -1)
{
$event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
} else {
$event->label = $obj->lastname;
}
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y');
$mois = dol_print_date($daycursor, '%m');
$jour = dol_print_date($daycursor, '%d');
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
} while ($daykey <= $event->date_end_in_calendar);
$i++;
// Show no symbol for leave with state "leave approved"
$event->percentage = -1;
} elseif ($obj->status == 2)
{
// Show TO-DO symbol for leave with state "leave wait for approval"
$event->percentage = 0;
}
if ($obj->halfday == 1)
{
$event->label = $obj->lastname.' ('.$langs->trans("Morning").')';
} elseif ($obj->halfday == -1)
{
$event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
} else {
$event->label = $obj->lastname;
}
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
} while ($daykey <= $event->date_end_in_calendar);
$i++;
}
}
// EXTERNAL CALENDAR
// Complete $eventarray with external import Ical
if (count($listofextcals))
{
@ -911,7 +933,7 @@ if (count($listofextcals))
$offsettz = $extcal['offsettz'];
$colorcal = $extcal['color'];
$buggedfile = $extcal['buggedfile'];
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal." buggedfile=".$buggedfile;
$ical = new ICal();
$ical->parse($url);
@ -1088,9 +1110,12 @@ if (count($listofextcals))
$event->userassigned[$userId] = $userId;
$event->percentage = -1;
}
else {
$event->type_code = "ICALEVENT";
}
$event->type_code = "ICALEVENT";
$event->type_label = $namecal;
$event->type_color = $colorcal;
$event->type = 'icalevent';
$event->type_picto = 'rss';
$event->icalname = $namecal;
$event->icalcolor = $colorcal;
@ -1149,15 +1174,15 @@ if (count($listofextcals))
// Add an entry in actionarray for each day
$daycursor = $event->date_start_in_calendar;
$annee = date('Y', $daycursor);
$mois = date('m', $daycursor);
$jour = date('d', $daycursor);
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
// daykey must be date that represent day box in calendar so must be a user time
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, true, 0);
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
do {
//if ($event->fulldayevent) print dol_print_date($daykeygmt,'dayhour','gmt').'-'.dol_print_date($daykey,'dayhour','gmt').'-'.dol_print_date($event->date_end_in_calendar,'dayhour','gmt').' ';
$eventarray[$daykey][] = $event;
@ -1205,9 +1230,11 @@ if (is_readable($color_file))
}
if (!is_array($theme_datacolor)) $theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220));
$massactionbutton ='';
print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.'<span class="marginleftonly"></span>'.$newcardbutton, '', $limit, 1, 0, 1, $viewmode);
// Show div with list of calendars
print $s;
@ -1343,14 +1370,14 @@ if (empty($action) || $action == 'show_month') // View by month
for ($iter_day = 0; $iter_day < 7; $iter_day++) {
// Show days of the current week
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
$tmparray = dol_getdate($curtime, true);
$tmpday = $tmparray['mday'];
$tmpmonth = $tmparray['mon'];
$tmpyear = $tmparray['year'];
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server
$tmpday = dol_print_date($curtime, '%d', 'tzuserrel');
$tmpmonth = dol_print_date($curtime, '%m', 'tzuserrel');
$tmpyear = dol_print_date($curtime, '%Y', 'tzuserrel');
$style = 'cal_current_month';
if ($iter_day == 6) $style .= ' cal_other_month_right';
$today = 0;
$todayarray = dol_getdate($now, 'fast');
if ($todayarray['mday'] == $tmpday && $todayarray['mon'] == $tmpmonth && $todayarray['year'] == $tmpyear) $today = 1;
@ -1486,6 +1513,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
global $theme_datacolor;
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
if ($conf->use_javascript_ajax) { // Enable the "Show more button..."
$conf->global->MAIN_JS_SWITCH_AGENDA = 1;
}
$dateint = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
print "\n";
@ -1501,11 +1532,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
// Line with title of day
print '<div id="dayevent_'.$dateint.'" class="cursorpointer dayevent tagtable centpercent nobordernopadding" onclick="window.location=\''.$urltocreate.'\';">'."\n";
print '<div id="dayevent_'.$dateint.'" class="dayevent tagtable centpercent nobordernopadding">'."\n";
if ($nonew <= 0)
{
print '<div class="tagtr"><div class="nowrap tagtd"><div class="left inline-block">';
print '<div class="tagtr cursorpointer" onclick="window.location=\''.$urltocreate.'\';"><div class="nowrap tagtd"><div class="left inline-block">';
print '<a class="dayevent-aday" style="color: #666" href="'.$urltoshow.'">';
if ($showinfo) print dol_print_date($curtime, 'daytextshort');
else print dol_print_date($curtime, '%d');
@ -1531,13 +1562,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '<div class="tagtd centpercent agendacell sortable">';
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
$i = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array();
$i = 0; $ireallyshown = 0; $itoshow = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array();
$ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
$colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0
$nextindextouse = is_array($colorindexused) ?count($colorindexused) : 0; // At first run this is 0, so fist user has 0, next 1, ...
//var_dump($colorindexused);
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$tmpholiday = new Holiday($db);
foreach ($eventarray as $daykey => $notused)
{
$annee = dol_print_date($daykey, '%Y');
@ -1583,7 +1617,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
} elseif ($event->type_code == 'BIRTHDAY')
{
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unmovable'; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday '; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
} else {
$numother++;
$color = ($event->icalcolor ? $event->icalcolor : -1);
@ -1617,20 +1651,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// Define color
$color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
}
$cssclass = $cssclass.' '.$cssclass.'_day_'.$ymd;
$cssclass = $cssclass.' eventday_'.$ymd;
// Defined style to disable drag and drop feature
if ($event->type_code == 'AC_OTH_AUTO')
{
if ($event->type_code == 'AC_OTH_AUTO') {
$cssclass .= " unmovable";
} elseif ($event->type_code == 'ICALEVENT')
{
} elseif ($event->type_code == 'HOLIDAY') {
$cssclass .= " unmovable";
} elseif ($event->type_code == 'BIRTHDAY') {
$cssclass .= " unmovable";
} elseif ($event->type_code == 'ICALEVENT') {
$cssclass .= " unmovable";
} elseif ($event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) {
$tmpyearend = date('Y', $event->date_end_in_calendar);
$tmpmonthend = date('m', $event->date_end_in_calendar);
$tmpdayend = date('d', $event->date_end_in_calendar);
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
if ($tmpyearend != $annee || $tmpmonthend != $mois || $tmpdayend != $jour)
{
$cssclass .= " unmovable";
}
@ -1648,10 +1684,29 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($action == 'show_day') { $h = 'height: 100%; '; $nowrapontd = 0; }
if ($action == 'show_week') { $h = 'height: 100%; '; $nowrapontd = 0; }
// Show rect of event
// Show event box
print "\n";
print '<!-- start event '.$i.' -->'."\n";
print '<div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'"';
$morecss = '';
if ($maxprint && $ireallyshown >= $maxprint) {
$morecss = 'showifmore';
}
if ($event->type == 'birthdate' && !GETPOST('check_birthday')) {
$morecss = 'hidden';
}
if ($event->type == 'holiday' && !GETPOST('check_holiday')) {
$morecss = 'hidden';
}
if ($morecss != 'hidden') {
$itoshow++;
}
if ($morecss != 'showifmore' && $morecss != 'hidden') {
$ireallyshown++;
}
//var_dump($event->type.' - '.$morecss.' - '.$cssclass.' - '.$i.' - '.$ireallyshown.' - '.$itoshow);
print '<div id="event_'.$ymd.'_'.$i.'" class="event family_'.$event->type.' '.$cssclass.($morecss ? ' '.$morecss : '').'"';
//print ' style="height: 100px;';
//print ' position: absolute; top: 40px; width: 50%;';
//print '"';
@ -1686,14 +1741,23 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$daterange = '';
if ($event->type_code == 'BIRTHDAY') // It's a birthday
{
if ($event->type_code == 'BIRTHDAY') { // It's birthday calendar
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact');
} elseif ($event->type_code == 'HOLIDAY')
{
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'holiday', 'user');
} elseif ($event->type_code != 'BIRTHDAY' && $event->type_code != 'HOLIDAY')
{
} elseif ($event->type_code == 'HOLIDAY') { // It's holiday calendar
$tmpholiday->fetch($event->id);
print $tmpholiday->getNomUrl(1);
$tmpid = $tmpholiday->fk_user;
if (empty($cacheusers[$tmpid])) {
$newuser = new User($db);
$newuser->fetch($tmpid);
$cacheusers[$tmpid] = $newuser;
}
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom');
print $listofusertoshow;
} else { // Other calendar
// Picto
if (empty($event->fulldayevent))
{
@ -1737,8 +1801,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel');
}
} else {
if ($showinfo)
{
if ($showinfo) {
print $langs->trans("EventOnFullDay")."<br>\n";
}
}
@ -1752,7 +1815,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$event->label = $titletoshow;
$event->libelle = $titletoshow;
// Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user.
$titletoshow = $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title', '', 0, 0);
$titletoshow = (($event->type_picto || $event->type_code) ? $event->getTypePicto() : '');
$titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title', '', 0, 0);
$event->label = $savlabel;
$event->libelle = $savlabel;
}
@ -1764,8 +1828,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
if (!$posuserassigned && $titletoshow) $listofusertoshow .= '<br>';
$posuserassigned++;
if (empty($cacheusers[$tmpid]))
{
if (empty($cacheusers[$tmpid])) {
$newuser = new User($db);
$newuser->fetch($tmpid);
$cacheusers[$tmpid] = $newuser;
@ -1837,6 +1900,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
else print '&nbsp;';
print '</td></tr></table>';
print '</div><!-- end event '.$i.' -->'."\n";
$i++;
} else {
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
@ -1859,22 +1923,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '&nbsp;';
}
if (!empty($conf->global->MAIN_JS_SWITCH_AGENDA) && $i > $maxprint && $maxprint)
if (!empty($conf->global->MAIN_JS_SWITCH_AGENDA) && $itoshow > $ireallyshown && $maxprint)
{
print '<div id="more_'.$ymd.'">'.img_picto("all", "1downarrow_selected.png").' +'.$langs->trans("More").'...</div>';
print '<div class="center cursorpointer" id="more_'.$ymd.'">'.img_picto("All", "angle-double-down", 'class="warning"').' +'.($itoshow - $ireallyshown).'</div>';
//print ' +'.(count($eventarray[$daykey])-$maxprint);
print '<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print 'jQuery("#more_'.$ymd.'").click(function() { reinit_day_'.$ymd.'(); });'."\n";
print 'function reinit_day_'.$ymd.'() {'."\n";
print 'var nb=0;'."\n";
// TODO Loop on each element of day $ymd and start to toggle once $maxprint has been reached
print 'jQuery(".family_mytasks_day_'.$ymd.'").toggle();';
print '}'."\n";
print ' var open=0;'."\n";
print ' jQuery("#more_'.$ymd.'").click(function() { console.log("Click on showmore for '.$ymd.'"); reinit_day_'.$ymd.'(); event.stopImmediatePropagation(); });'."\n";
print ' function reinit_day_'.$ymd.'() {'."\n";
print ' jQuery(".eventday_'.$ymd.'.showifmore").toggle();'."\n";
print ' open = open + 1; if (open > 1) { open = 0; }'."\n";
print ' if (open) { ';
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-up", 'class="warning"').'\');'."\n";
print ' } else { ';
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-down", 'class="warning"').' +'.($itoshow - $ireallyshown).'\');'."\n";
print ' }'."\n";
print ' }'."\n";
print '});'."\n";
print '</script>'."\n";
}
@ -1921,7 +1988,6 @@ function sort_events_by_date($a, $b)
{
return -1;
}
if ($b->type_code === 'HOLIDAY')
{
return 1;

View File

@ -269,11 +269,11 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($search_status != '' && $search_status > -1) $param .= "&search_status=".urlencode($search_status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($socid) $param .= "&search_socid=".urlencode($socid);
if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid > 0) $param .= "&search_socid=".urlencode($socid);
if ($showbirthday) $param .= "&search_showbirthday=1";
if ($pid) $param .= "&search_projectid=".urlencode($pid);
if ($type) $param .= "&search_type=".urlencode($type);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
if ($search_id != '') $param .= '&search_title='.urlencode($search_id);
if ($search_title != '') $param .= '&search_title='.urlencode($search_title);
if ($search_note != '') $param .= '&search_note='.$search_note;
@ -287,6 +287,8 @@ if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$paramnoactionodate = $param;
// List of mass actions available
$arrayofmassactions = array(
'set_all_events_to_todo' => $langs->trans("SetAllEventsToTodo"),
@ -308,7 +310,7 @@ $sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulld
$sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= " a.fk_contact, a.note, a.percent as percent,";
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
$sql .= " c.code as type_code, c.libelle as type_label,";
$sql .= " c.code as type_code, c.libelle as type_label, c.color as type_color, c.type as type_type, c.picto as type_picto,";
$sql .= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
// Add fields from extrafields
@ -481,31 +483,31 @@ if ($resql)
}
$viewmode = '';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
@ -657,6 +659,7 @@ if ($resql)
$actionstatic->type_code = $obj->type_code;
$actionstatic->type_label = $obj->type_label;
$actionstatic->type_picto = $obj->type_picto;
$actionstatic->type_color = $obj->type_color;
$actionstatic->label = $obj->label;
$actionstatic->location = $obj->location;
$actionstatic->note_private = dol_htmlentitiesbr($obj->note);

View File

@ -236,8 +236,8 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid) $param .= "&search_socid=".urlencode($socid);
if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid > 0) $param .= "&search_socid=".urlencode($socid);
if ($showbirthday) $param .= "&search_showbirthday=1";
if ($pid) $param .= "&search_projectid=".urlencode($pid);
if ($type) $param .= "&search_type=".urlencode($type);
@ -248,6 +248,8 @@ if ($begin_d != '') $param .= '&begin_d='.urlencode($begin_d);
if ($end_d != '') $param .= '&end_d='.urlencode($end_d);
$param .= "&maxprint=".urlencode($maxprint);
$paramnoactionodate = $param;
$prev = dol_get_first_day($year, 1);
$prev_year = $year - 1;
$prev_month = $month;
@ -352,31 +354,31 @@ if ($conf->use_javascript_ajax)
$massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
@ -430,6 +432,8 @@ print '</div>';
// Get event in an array
$eventarray = array();
// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
$sql = 'SELECT';
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= ' a.id, a.label,';
@ -439,7 +443,7 @@ $sql .= ' a.percent,';
$sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,';
$sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
$sql .= ' ca.code, ca.color';
$sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto';
$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table

View File

@ -236,8 +236,8 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid) $param .= "&search_socid=".urlencode($socid);
if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid > 0) $param .= "&search_socid=".urlencode($socid);
if ($showbirthday) $param .= "&search_showbirthday=1";
if ($pid) $param .= "&search_projectid=".urlencode($pid);
if ($type) $param .= "&search_type=".urlencode($type);
@ -248,6 +248,7 @@ if ($begin_d != '') $param .= '&begin_d='.urlencode($begin_d);
if ($end_d != '') $param .= '&end_d='.urlencode($end_d);
$param .= "&maxprint=".urlencode($maxprint);
$paramnoactionodate = $param;
$prev = dol_get_first_day_week($day, $month, $year);
//print "day=".$day." month=".$month." year=".$year;
@ -357,31 +358,31 @@ if ($conf->use_javascript_ajax)
$massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
@ -435,10 +436,11 @@ print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $show
print '</div>';
// Get event in an array
$eventarray = array();
// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
$sql = 'SELECT';
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= ' a.id, a.label,';
@ -448,7 +450,7 @@ $sql .= ' a.percent,';
$sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,';
$sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
$sql .= ' ca.code, ca.color';
$sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto';
$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table

View File

@ -116,6 +116,11 @@ $pagenext = $page + 1;
if (!$sortfield) $sortfield = 'p.ref';
if (!$sortorder) $sortorder = 'DESC';
$permissiontoread = $user->rights->propal->lire;
$permissiontoadd = $user->rights->propal->write;
$permissiontodelete = $user->rights->propal->supprimer;
$permissiontoclose = $user->rights->propal->cloturer;
// Security check
$module = 'propal';
$dbtable = '';
@ -260,13 +265,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
}
if ($object_statut != '') $search_status = $object_statut;
if (empty($reshook))
{
$objectclass = 'Propal';
$objectlabel = 'Proposals';
$permissiontoread = $user->rights->propal->lire;
$permissiontodelete = $user->rights->propal->supprimer;
$permissiontoclose = $user->rights->propal->cloturer;
$uploaddir = $conf->propal->multidir_output[$conf->entity];
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -1492,7 +1495,7 @@ if ($resql)
print $formfile->showdocuments('massfilesarea_proposals', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
} else {
dol_print_error($db);
dol_print_error($db);
}
// End of page

View File

@ -61,7 +61,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
* View
*/
llxHeader('', $langs->trans('Proposal'), 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
llxHeader('', $langs->trans('Proposal'), $help_url);
$form = new Form($db);

View File

@ -238,7 +238,7 @@ if (empty($reshook))
elseif ($action == 'add' && $usercancreate)
{
$datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
$date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$selectedLines = GETPOST('toselect', 'array');
if ($datecommande == '') {
@ -271,8 +271,8 @@ if (empty($reshook))
$object->fk_account = GETPOST('fk_account', 'int');
$object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id');
$object->date_livraison = $datelivraison; // deprecated
$object->delivery_date = $datelivraison;
$object->date_livraison = $date_delivery; // deprecated
$object->delivery_date = $date_delivery;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->warehouse_id = GETPOST('warehouse_id', 'int');
$object->fk_delivery_address = GETPOST('fk_address');
@ -1628,7 +1628,7 @@ if ($action == 'create' && $usercancreate)
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">';
$date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery);
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print $form->selectDate($date_delivery ? $date_delivery : -1, 'liv_', 1, 1, 1);
print "</td>\n";
print '</tr>';

View File

@ -3283,6 +3283,7 @@ class Commande extends CommonOrder
if (isset($this->note_public)) $this->note_public = trim($this->note_public);
if (isset($this->model_pdf)) $this->model_pdf = trim($this->model_pdf);
if (isset($this->import_key)) $this->import_key = trim($this->import_key);
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
// Check parameters
// Put here code to add control on parameters values
@ -3307,6 +3308,8 @@ class Commande extends CommonOrder
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
$sql .= " date_livraison=".(strval($this->delivery_date) != '' ? "'".$this->db->idate($this->delivery_date)."'" : 'null').",";
$sql .= " fk_shipping_method=".(isset($this->shipping_method_id) ? $this->shipping_method_id : "null").",";
$sql .= " fk_account=".($this->fk_account > 0 ? $this->fk_account : "null").",";
$sql .= " fk_input_reason=".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null").",";
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -128,23 +129,17 @@ $userstatic = new User($db);
/* */
/* *************************************************************************** */
if ($id > 0 || !empty($ref))
{
$langs->trans("OrderCard");
if ($object->fetch($id, $ref) > 0)
{
if ($id > 0 || !empty($ref)) {
if ($object->fetch($id, $ref) > 0) {
$object->fetch_thirdparty();
$head = commande_prepare_head($object);
print dol_get_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order');
// Order card
$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
// Ref customer
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);

View File

@ -1398,7 +1398,7 @@ if ($resql)
if ($links[$key]['type'] == 'payment_salary') $type_link = 'payment_salary';
}
$sqlu = "SELECT url_id FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$objp->rowid." AND type='user'";
$sqlu = "SELECT url_id FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$objp->rowid." AND (type='user' OR type='salary')";
$resqlu = $db->query($sqlu);
if ($resqlu) {

View File

@ -585,7 +585,7 @@ foreach ($accounts as $key=>$type)
if (!empty($arrayfields['balance']['checked']))
{
print '<td class="nowraponall right">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$objecttmp->id.'">'.price($solde, 0, $langs, 0, -1, -1, $objecttmp->currency_code).'</a>';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$objecttmp->id.'">'.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).'</a>';
print '</td>';
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'balance';

View File

@ -58,6 +58,10 @@ $search_accountancy_account = GETPOST("search_accountancy_account");
if ($search_accountancy_account == - 1) $search_accountancy_account = '';
$search_accountancy_subledger = GETPOST("search_accountancy_subledger");
if ($search_accountancy_subledger == - 1) $search_accountancy_subledger = '';
if (empty($search_datep_start)) $search_datep_start = GETPOST("search_datep_start", 'int');
if (empty($search_datep_end)) $search_datep_end = GETPOST("search_datep_end", 'int');
if (empty($search_datev_start)) $search_datev_start = GETPOST("search_datev_start", 'int');
if (empty($search_datev_end)) $search_datev_end = GETPOST("search_datev_end", 'int');
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');

View File

@ -73,9 +73,10 @@ $terminalid = $cashcontrol->posnumber;
* View
*/
$title = $langs->trans("CashControl");
$param = '';
llxHeader('', $langs->trans("CashControl"), '', '', 0, 0, array(), array(), $param);
llxHeader('', $title, '', '', 0, 0, array(), array(), $param);
/*$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
$sql.= " b.fk_account, b.fk_type,";

View File

@ -289,11 +289,11 @@ if (empty($reshook))
elseif ($action == 'setref' && $user->rights->facture->creer)
{
//var_dump(GETPOST('ref', 'alpha'));exit;
$result = $object->setValueFrom('title', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
$result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
if ($result > 0)
{
$object->titre = GETPOST('ref', 'alpha'); // deprecated
$object->title = GETPOST('ref', 'alpha');
$object->titre = $ref; // deprecated
$object->title = $ref;
$object->ref = $object->title;
} else {
$error++;

View File

@ -4120,7 +4120,7 @@ if ($action == 'create')
if ($objectidnext > 0) {
$facthatreplace = new Facture($db);
$facthatreplace->fetch($objectidnext);
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')</span>';
print ' <span class="opacitymediumbycolor paddingleft">('.str_replace('{s1}', $facthatreplace->getNomUrl(1), $langs->transnoentities("ReplacedByInvoice", '{s1}')).')</span>';
}
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
@ -4128,7 +4128,10 @@ if ($action == 'create')
$result = $discount->fetch(0, $object->id);
if ($result > 0) {
print ' <span class="opacitymediumbycolor paddingleft">';
print $langs->transnoentities("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount'));
$s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}');
$s = str_replace('{s1}', $object->getLibType(1), $s);
$s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s);
print $s;
print '</span><br>';
}
}
@ -4139,7 +4142,9 @@ if ($action == 'create')
$result = $tmptemplate->fetch($object->fk_fac_rec_source);
if ($result > 0) {
print ' <span class="opacitymediumbycolor paddingleft">';
print $langs->transnoentities("GeneratedFromTemplate", '<a href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$tmptemplate->id.'">'.dol_escape_htmltag($tmptemplate->ref).'</a>');
$s = $langs->transnoentities("GeneratedFromTemplate", '{s1}');
$s = str_replace('{s1}', '<a href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$tmptemplate->id.'">'.dol_escape_htmltag($tmptemplate->ref).'</a>', $s);
print $s;
print '</span>';
}
}

View File

@ -268,7 +268,7 @@ if ($search_status != '' && $search_status >= -1)
if ($search_status == -1) $sql .= ' AND suspended = 1';
}
$sql .= dolSqlDateFilter('f.date_last_gen', $search_day, $search_month, $search_year);
$sql .= dolSqlDateFilter('f.date_last_gen', $search_day_date_when, $search_month_date_when, $search_year_date_when);
$sql .= dolSqlDateFilter('f.date_when', $search_day_date_when, $search_month_date_when, $search_year_date_when);
$sql .= $db->order($sortfield, $sortorder);

View File

@ -1312,7 +1312,7 @@ class Paiement extends CommonObject
$invoice = new Facture($this->db);
if ($invoice->fetch($billsarray[0]) > 0)
{
$force_thirdparty_id = $invoice->fk_soc;
$force_thirdparty_id = $invoice->socid;
}
}
}

View File

@ -252,7 +252,7 @@ if ($modecompta == 'BOOKKEEPING')
$sql .= " AND f.entity = ".$conf->entity;
if (!empty($date_start) && !empty($date_end))
$sql .= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'";
$sql .= " GROUP BY pcg_type, name, socid";
$sql .= " GROUP BY pcg_type DESC, name, socid";
$sql .= $db->order($sortfield, $sortorder);
$oldpcgtype = '';
@ -284,6 +284,15 @@ if ($modecompta == 'BOOKKEEPING')
$total_ht += (isset($objp->amount) ? $objp->amount : 0);
$total_ttc += (isset($objp->amount) ? $objp->amount : 0);
if ($objp->pcg_type == 'INCOME') {
$total_ht_income += (isset($objp->amount) ? $objp->amount : 0);
$total_ttc_income += (isset($objp->amount) ? $objp->amount : 0);
}
if ($objp->pcg_type == 'EXPENSE') {
$total_ht_outcome -= (isset($objp->amount) ? $objp->amount : 0);
$total_ttc_outcome -= (isset($objp->amount) ? $objp->amount : 0);
}
// Loop on detail of all accounts
// This make 14 calls for each detail of account (NP, N and month m)
if ($showaccountdetail != 'no')
@ -446,6 +455,7 @@ if ($modecompta == 'BOOKKEEPING')
$total_ht_income += $total_ht;
$total_ttc_income += $total_ttc;
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES')
print '<td colspan="3" class="right">'.price($total_ht).'</td>';
@ -525,11 +535,12 @@ if ($modecompta == 'BOOKKEEPING')
$total_ht_income += $subtotal_ht;
$total_ttc_income += $subtotal_ttc;
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES')
print '<td colspan="3" class="right">'.price($subtotal_ht).'</td>';
print '<td colspan="3" class="right">'.price($subtotal_ttc).'</td>';
print '</tr>';
print '<td colspan="3" class="right">'.price($subtotal_ttc).'</td>';
print '</tr>';
}
/*
@ -609,6 +620,7 @@ if ($modecompta == 'BOOKKEEPING')
$total_ht_outcome += $subtotal_ht;
$total_ttc_outcome += $subtotal_ttc;
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES')
print '<td colspan="3" class="right">'.price(-$subtotal_ht).'</td>';
@ -686,6 +698,7 @@ if ($modecompta == 'BOOKKEEPING')
$total_ht_outcome += $subtotal_ht;
$total_ttc_outcome += $subtotal_ttc;
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES')
print '<td colspan="3" class="right">'.price(-$subtotal_ht).'</td>';
@ -764,6 +777,7 @@ if ($modecompta == 'BOOKKEEPING')
$total_ht_outcome += $subtotal_ht;
$total_ttc_outcome += $subtotal_ttc;
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES')
print '<td colspan="3" class="right">'.price(-$subtotal_ht).'</td>';
@ -841,6 +855,7 @@ if ($modecompta == 'BOOKKEEPING')
$total_ht_outcome += $subtotal_ht;
$total_ttc_outcome += $subtotal_ttc;
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES')
print '<td colspan="3" class="right">'.price(-$subtotal_ht).'</td>';
@ -926,6 +941,7 @@ if ($modecompta == 'BOOKKEEPING')
$total_ht_outcome += $subtotal_ht;
$total_ttc_outcome += $subtotal_ttc;
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES') print '<td colspan="3" class="right">'.price(-$subtotal_ht).'</td>';
print '<td colspan="3" class="right">'.price(-$subtotal_ttc).'</td>';
@ -963,6 +979,7 @@ if ($modecompta == 'BOOKKEEPING')
{
$subtotal_ht += -$obj->amount;
$subtotal_ttc += -$obj->amount;
$total_ht_outcome += $obj->amount;
$total_ttc_outcome += $obj->amount;
}
@ -978,6 +995,7 @@ if ($modecompta == 'BOOKKEEPING')
{
$subtotal_ht += $obj->amount;
$subtotal_ttc += $obj->amount;
$total_ht_income += $obj->amount;
$total_ttc_income += $obj->amount;
}
@ -1038,8 +1056,10 @@ if ($modecompta == 'BOOKKEEPING')
}
$total_ht += $subtotal_ht;
$total_ttc += $subtotal_ttc;
$total_ht_income += $subtotal_ht;
$total_ttc_income += $subtotal_ttc;
print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES')
print '<td colspan="3" class="right">'.price($subtotal_ht).'</td>';
@ -1101,8 +1121,10 @@ if ($modecompta == 'BOOKKEEPING')
} else {
dol_print_error($db);
}
$total_ht_outcome -= 0;
$total_ttc_outcome -= $amount;
print '<tr class="oddeven"><td>&nbsp;</td>';
print "<td>".$langs->trans("VATToPay")."</td>\n";
print '<td class="right">&nbsp;</td>'."\n";
@ -1151,6 +1173,7 @@ if ($modecompta == 'BOOKKEEPING')
} else {
dol_print_error($db);
}
$total_ht_income += 0;
$total_ttc_income += $amount;
@ -1197,8 +1220,10 @@ if ($modecompta == 'BOOKKEEPING')
} else {
dol_print_error($db);
}
$total_ht_outcome -= 0;
$total_ttc_outcome -= $amount;
print '<tr class="oddeven"><td>&nbsp;</td>';
print "<td>".$langs->trans("VATPaid")."</td>\n";
if ($modecompta == 'CREANCES-DETTES')
@ -1243,8 +1268,10 @@ if ($modecompta == 'BOOKKEEPING')
} else {
dol_print_error($db);
}
$total_ht_income += 0;
$total_ttc_income += $amount;
print '<tr class="oddeven"><td>&nbsp;</td>';
print "<td>".$langs->trans("VATCollected")."</td>\n";
if ($modecompta == 'CREANCES-DETTES')
@ -1279,19 +1306,22 @@ print '<tr>';
print '<td colspan="4">&nbsp;</td>';
print '</tr>';
print '<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans("Outcome").'</td>';
if ($modecompta == 'CREANCES-DETTES')
print '<td class="liste_total right">'.price(price2num(-$total_ht_outcome, 'MT')).'</td>';
print '<td class="liste_total right">'.price(price2num(-$total_ttc_outcome, 'MT')).'</td>';
print '</tr>';
print '<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans("Income").'</td>';
if ($modecompta == 'CREANCES-DETTES')
if ($modecompta == 'CREANCES-DETTES') {
print '<td class="liste_total right">'.price(price2num($total_ht_income, 'MT')).'</td>';
}
print '<td class="liste_total right">'.price(price2num($total_ttc_income, 'MT')).'</td>';
print '</tr>';
print '<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans("Outcome").'</td>';
if ($modecompta == 'CREANCES-DETTES') {
print '<td class="liste_total right">'.price(price2num(-$total_ht_outcome, 'MT')).'</td>';
}
print '<td class="liste_total right">'.price(price2num(-$total_ttc_outcome, 'MT')).'</td>';
print '</tr>';
print '<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans("Profit").'</td>';
if ($modecompta == 'CREANCES-DETTES')
if ($modecompta == 'CREANCES-DETTES') {
print '<td class="liste_total right">'.price(price2num($total_ht, 'MT')).'</td>';
}
print '<td class="liste_total right">'.price(price2num($total_ttc, 'MT')).'</td>';
print '</tr>';

View File

@ -866,9 +866,9 @@ if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
if ($obj->pcg_type == 'INCOME') {
if (!isset($encaiss[$obj->dm])) $encaiss[$obj->dm] = 0; // To avoid warning of var not defined
$encaiss[$obj->dm] += $obj->credit;
$encaiss[$obj->dm] -= $obj->credit;
$encaiss[$obj->dm] -= $obj->debit;
}
if ($obj->pcg_type == 'INCOME') {
if ($obj->pcg_type == 'EXPENSE') {
if (!isset($decaiss[$obj->dm])) $decaiss[$obj->dm] = 0; // To avoid warning of var not defined
$decaiss[$obj->dm] += $obj->debit;
$decaiss[$obj->dm] -= $obj->credit;

View File

@ -359,7 +359,7 @@ if ($action == 'create')
print '<tr><td>';
print $langs->trans('Employee');
print '</td>';
print '<td>'.$form->select_dolusers($fk_user, 'userid', 1).'</td></tr>';
print '<td>'.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).'</td></tr>';
// Project
if (!empty($conf->projet->enabled))
@ -371,7 +371,7 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("Project").'</td><td>';
$numproject = $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1);
print '</td></tr>';
}
@ -385,7 +385,7 @@ if ($action == 'create')
if (!empty($conf->banque->enabled))
{
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
$form->select_comptes($fk_account, 'fk_account', 0, '', 2);
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 2, '', 0, '', 1);
print '</td></tr>';
}

View File

@ -43,7 +43,11 @@ $id = GETPOST("id", 'int');
$action = GETPOST("action", "alpha");
$confirm = GETPOST('confirm');
$refund = GETPOST("refund", "int");
$auto_create_payment = GETPOST("auto_create_paiement", "int");
if (GETPOSTISSET('auto_create_paiement') || $action === 'add') {
$auto_create_payment = GETPOST("auto_create_paiement", "int");
} else {
$auto_create_payment = empty($conf->global->CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT);
}
if (empty($refund)) $refund = 0;
@ -377,17 +381,10 @@ if ($action == 'create')
if (!empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript" language="javascript">';
print '$(document).ready(function () {
$("#radiopayment").click(function() {
$("#label").val($(this).data("label"));
});
$("#radiorefund").click(function() {
$("#label").val($(this).data("label"));
});
$("#auto_create_paiement").click(function() {
if($(this).is(":checked")) {
print /** @lang JavaScript */'
$(document).ready(function () {
let onAutoCreatePaiementChange = function () {
if($("#auto_create_paiement").is(":checked")) {
$("#label_fk_account").addClass("fieldrequired");
$("#label_type_payment").addClass("fieldrequired");
$(".hide_if_no_auto_create_payment").show();
@ -396,21 +393,21 @@ if ($action == 'create')
$("#label_type_payment").removeClass("fieldrequired");
$(".hide_if_no_auto_create_payment").hide();
}
});';
};
$("#radiopayment").click(function() {
$("#label").val($(this).data("label"));
});
$("#radiorefund").click(function() {
$("#label").val($(this).data("label"));
if ($_REQUEST['action'] === 'add') { // form has been send but there is at least one error
if (empty($auto_create_payment)) {
print '$("#label_fk_account").removeClass("fieldrequired");
$("#label_type_payment").removeClass("fieldrequired");
$(".hide_if_no_auto_create_payment").hide();';
} else {
print '$("#label_fk_account").addClass("fieldrequired");
$("#label_type_payment").addClass("fieldrequired");
$(".hide_if_no_auto_create_payment").show();';
}
}
});
$("#auto_create_paiement").click(function () {
onAutoCreatePaiementChange();
});
onAutoCreatePaiementChange();
});
';
print '});';
print '</script>'."\n";
}
@ -475,7 +472,7 @@ if ($action == 'create')
// Auto create payment
print '<tr><td>'.$langs->trans('AutomaticCreationPayment').'</td>';
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" '.($_REQUEST['action'] === 'add' ? (empty($auto_create_payment) ? '' : 'checked="checked"') : 'checked="checked"').' value="1"></td></tr>'."\n";
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_payment) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n";
// Number
print '<tr class="hide_if_no_auto_create_payment"><td>'.$langs->trans('Numero');

View File

@ -889,8 +889,8 @@ if (empty($reshook))
$action = 'editref';
} else {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$old_filedir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($old_ref);
$new_filedir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($object->ref);
$old_filedir = $conf->contrat->multidir_output[$object->entity].'/'.dol_sanitizeFileName($old_ref);
$new_filedir = $conf->contrat->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
$files = dol_dir_list($old_filedir);
if (!empty($files))
@ -935,7 +935,7 @@ if (empty($reshook))
// Actions to build doc
$upload_dir = $conf->contrat->dir_output;
$upload_dir = $conf->contrat->multidir_output[$object->entity];
$permissiontoadd = $user->rights->contrat->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
@ -2137,13 +2137,13 @@ if ($action == 'create')
* Documents generes
*/
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->contrat->dir_output."/".dol_sanitizeFileName($object->ref);
$filedir = $conf->contrat->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = $user->rights->contrat->lire;
$delallowed = $user->rights->contrat->creer;
print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, ($object->model_pdf ? $object->model_pdf : $conf->global->CONTRACT_ADDON_PDF), 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object);
// Show links to link elements
@ -2168,7 +2168,7 @@ if ($action == 'create')
// Presend form
$modelmail = 'contract';
$defaulttopic = 'SendContractRef';
$diroutput = $conf->contrat->dir_output;
$diroutput = $conf->contrat->multidir_output[$object->entity];
$trackid = 'con'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';

View File

@ -1296,7 +1296,7 @@ class Contrat extends CommonObject
$ref = dol_sanitizeFileName($this->ref);
if ($conf->contrat->dir_output)
{
$dir = $conf->contrat->dir_output."/".$ref;
$dir = $conf->contrat->multidir_output[$this->entity]."/".$ref;
if (file_exists($dir))
{
$res = @dol_delete_dir_recursive($dir);

View File

@ -74,7 +74,7 @@ if ($object->id > 0)
$object->fetch_thirdparty();
}
$upload_dir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($object->ref);
$upload_dir = $conf->contrat->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'contract';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context

View File

@ -204,7 +204,7 @@ $formcompany = new FormCompany($db);
$contracttmp = new Contrat($db);
$sql = 'SELECT';
$sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,";
$sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,";
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias, s.email, s.town, s.zip, s.fk_pays as country_id, s.client, s.code_client, s.status as company_status, s.logo as company_logo,';
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -260,7 +260,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,";
$sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,";
$sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.status, s.logo,';
$sql .= " typent.code,";
$sql .= " state.code_departement, state.nom";
@ -644,7 +644,7 @@ while ($i < min($num, $limit))
}
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($obj->ref);
$filedir = $conf->contrat->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print $formfile->getDocumentsLink($contracttmp->element, $filename, $filedir);
print '</td>';

View File

@ -1097,6 +1097,7 @@ if ($action == 'remove_file')
$action = '';
}
// Validate records
if (!$error && $massaction == 'validate' && $permissiontoadd)
{

View File

@ -135,7 +135,7 @@ class box_comptes extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right nowraponall"',
'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code)
'text' => price($solde, 0, $langs, 1, -1, -1, $objp->currency_code)
);
$line++;

View File

@ -839,7 +839,7 @@ class ExtraFields
$array_name_label = array();
// We should not have several time this request. If we have, there is some optimization to do by calling a simple $extrafields->fetch_optionals() in top of code and not into subcode
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,printable,totalizable,fielddefault,fieldcomputed,entity,enabled,help";
$sql = "SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help";
$sql .= " FROM ".MAIN_DB_PREFIX."extrafields";
//$sql.= " WHERE entity IN (0,".$conf->entity.")"; // Filter is done later
if ($elementtype) $sql .= " WHERE elementtype = '".$this->db->escape($elementtype)."'"; // Filed with object->table_element

View File

@ -248,7 +248,7 @@ class HookManager
$actionclassinstance->error = 0;
$actionclassinstance->errors = array();
dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", action=".$action." context=".$context, LOG_DEBUG);
dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".get_class($actionclassinstance).'->'.$method.", context=".$context.", module=".$module.", action=".$action.((is_object($object) && property_exists($object, 'id')) ? ', objectid='.$object->id : ''), LOG_DEBUG);
// Add current context to avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return;
$parameters['currentcontext'] = $context;

View File

@ -253,9 +253,9 @@ class Form
if (empty($notabletag)) $ret .= '<td class="left">';
//else $ret.='<div class="clearboth"></div>';
$ret .= '<input type="submit" class="button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) $ret .= '<br>'."\n";
$ret .= '<input type="submit" class="button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
if (empty($notabletag)) $ret .= '</td>';
if (empty($notabletag)) $ret .= '</tr></table>'."\n";
@ -672,7 +672,7 @@ class Form
// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
$ret .= '<input type="submit" disabled name="confirmmassaction" class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '</div>';
if (!empty($conf->use_javascript_ajax))
@ -984,6 +984,7 @@ class Form
print '>'.$langs->trans("Service");
print '</select>';
print ajax_combobox('select_'.$htmlname);
//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
}
if ((empty($forceall) && empty($conf->product->enabled) && !empty($conf->service->enabled)) || $forceall == 3)
@ -2753,9 +2754,10 @@ class Form
* @param int $hidelabel Hide label (0=no, 1=yes)
* @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices
* @param string $morecss More CSS
* @param string $placeholder Placeholder
* @return void
*/
public function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '')
public function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '', $placeholder = '')
{
// phpcs:enable
global $langs, $conf;
@ -2776,9 +2778,9 @@ class Form
// mode=2 means suppliers products
$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'">';
print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
} else {
print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss);
print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
}
}
@ -2798,9 +2800,10 @@ class Form
* @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices
* @param string $morecss Add more CSS
* @param int $showstockinlist Show stock information (slower).
* @param string $placeholder Placeholder
* @return array Array of keys for json
*/
public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0)
public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0, $placeholder = '')
{
// phpcs:enable
global $langs, $conf, $db, $user;
@ -2884,9 +2887,9 @@ class Form
$num = $this->db->num_rows($result);
//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax
$out .= '<select class="flat maxwidthonsmartphone'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
if (!$selected) $out .= '<option value="0" selected>&nbsp;</option>';
else $out .= '<option value="0">&nbsp;</option>';
$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
if (!$selected) $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
else $out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
$i = 0;
while ($i < $num)
@ -3101,7 +3104,7 @@ class Form
// Add new entry
// "key" value of json key array is used by jQuery automatically as selected value
// "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax
// "label" value of json key array is used by jQuery automatically as text for combo box
$out .= $opt;
array_push($outarray,
@ -3109,12 +3112,12 @@ class Form
'value'=>$outref,
'label'=>$outval,
'qty'=>$outqty,
'up'=>$objp->unitprice,
'price_ht'=>price2num($objp->unitprice, 'MT'),
'discount'=>$outdiscount,
'type'=>$outtype,
'duration_value'=>$outdurationvalue,
'duration_unit'=>$outdurationunit,
'disabled'=>(empty($objp->idprodfournprice) ?true:false),
'disabled'=>(empty($objp->idprodfournprice) ? true : false),
'description'=>$objp->description
)
);
@ -4164,6 +4167,7 @@ class Form
print '<form method="POST" action="'.$page.'">';
print '<input type="hidden" name="action" value="setbankaccount">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
if ($nbaccountfound > 0) print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>';
@ -4362,14 +4366,11 @@ class Form
$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
if ($input['type'] == 'text')
{
if ($input['type'] == 'text') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'password')
{
} elseif ($input['type'] == 'password') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'select')
{
} elseif ($input['type'] == 'select') {
if (empty($morecss)) {
$morecss = 'minwidth100';
}
@ -4377,8 +4378,7 @@ class Form
if (!empty($input['label'])) $more .= $input['label'].'</div><div class="tagtd left">';
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss);
$more .= '</div></div>'."\n";
} elseif ($input['type'] == 'checkbox')
{
} elseif ($input['type'] == 'checkbox') {
$more .= '<div class="tagtr">';
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$moreattr;
@ -4387,8 +4387,7 @@ class Form
if (isset($input['disabled'])) $more .= ' disabled';
$more .= ' /></div>';
$more .= '</div>'."\n";
} elseif ($input['type'] == 'radio')
{
} elseif ($input['type'] == 'radio') {
$i = 0;
foreach ($input['values'] as $selkey => $selval)
{
@ -4403,8 +4402,7 @@ class Form
$more .= '</div></div>'."\n";
$i++;
}
} elseif ($input['type'] == 'date')
{
} elseif ($input['type'] == 'date') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
$more .= '<div class="tagtd">';
$more .= $this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, 0);
@ -4414,17 +4412,17 @@ class Form
$formquestion[] = array('name'=>$input['name'].'year');
$formquestion[] = array('name'=>$input['name'].'hour');
$formquestion[] = array('name'=>$input['name'].'min');
} elseif ($input['type'] == 'other')
{
} elseif ($input['type'] == 'other') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
if (!empty($input['label'])) $more .= $input['label'].'</div><div class="tagtd">';
$more .= $input['value'];
$more .= '</div></div>'."\n";
} elseif ($input['type'] == 'onecolumn')
{
} elseif ($input['type'] == 'onecolumn') {
$moreonecolumn .= '<div class="margintoponly">';
$moreonecolumn .= $input['value'];
$moreonecolumn .= '</div>'."\n";
} elseif ($input['type'] == 'hidden') {
// Do nothing more, already added by a previous loop
} else {
$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
}
@ -6303,7 +6301,7 @@ class Form
*/
public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0)
{
global $conf, $langs, $user;
global $conf, $langs, $user, $hookmanager;
//print "$objecttmp->filter, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled";
@ -6349,27 +6347,34 @@ class Form
}
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe')
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE 1=1";
if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
$sql .= ' AND parenttable.entity = t.'.$tmparray[0];
}
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
if ($objecttmp->element == 'societe') $sql .= " AND t.rowid = ".$user->socid;
else $sql .= " AND t.fk_soc = ".$user->socid;
}
if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey);
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
}
if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
/*if (! DolibarrApi::_checkFilters($objecttmp->filter))
{
throw new RestException(503, 'Error when validating parameter sqlfilters '.$objecttmp->filter);
}*/
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'Form::forgeCriteriaCallback', $objecttmp->filter).")";
}
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('selectForFormsListWhere', $parameters); // Note that $action and $object may have been modified by hook
if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint;
else {
$sql .= " WHERE 1=1";
if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
$sql .= ' AND parenttable.entity = t.'.$tmparray[0];
}
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
if ($objecttmp->element == 'societe') $sql .= " AND t.rowid = ".$user->socid;
else $sql .= " AND t.fk_soc = ".$user->socid;
}
if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey);
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
}
if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
/*if (! DolibarrApi::_checkFilters($objecttmp->filter))
{
throw new RestException(503, 'Error when validating parameter sqlfilters '.$objecttmp->filter);
}*/
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'Form::forgeCriteriaCallback', $objecttmp->filter).")";
}
}
$sql .= $this->db->order($fieldstoshow, "ASC");
//$sql.=$this->db->plimit($limit, 0);
//print $sql;

View File

@ -355,7 +355,7 @@ class FormActions
if (!is_array($selected) && !empty($selected)) $selected = explode(',', $selected);
$out .= $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
} else {
$out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200'.($morecss ? ' '.$morecss : ''), 1);
$out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth300'.($morecss ? ' '.$morecss : ''), 1);
}
if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0)

View File

@ -77,7 +77,7 @@ class FormAdmin
if ($showempty && !$multiselect)
{
$out .= '<option value="0"';
if ($selected == '') $out .= ' selected';
if ($selected === '') $out .= ' selected';
$out .= '>';
if ($showempty != '1') $out .= $showempty;
else $out .= '&nbsp;';
@ -86,7 +86,7 @@ class FormAdmin
if ($showauto)
{
$out .= '<option value="auto"';
if ($selected == 'auto') $out .= ' selected';
if ($selected === 'auto') $out .= ' selected';
$out .= '>'.$langs->trans("AutoDetectLang").'</option>';
}
@ -115,7 +115,7 @@ class FormAdmin
}
$valuetoshow .= ' '.picto_from_langcode($key, 'class="saturatemedium"');
if ($selected == $keytouse) {
if ((string) $selected == (string) $keytouse) {
$out .= '<option value="'.$keytouse.'" selected data-html="'.dol_escape_htmltag($valuetoshow).'">'.$valuetoshow.'</option>';
} else {
$out .= '<option value="'.$keytouse.'" data-html="'.dol_escape_htmltag($valuetoshow).'">'.$valuetoshow.'</option>';

View File

@ -450,7 +450,7 @@ class FormFile
if ($modulepart == 'company')
{
$showempty = 1;
$showempty = 1; // can have no template active
if (is_array($genallowed)) $modellist = $genallowed;
else {
include_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php';
@ -514,6 +514,7 @@ class FormFile
}
} elseif ($modulepart == 'contract')
{
$showempty = 1; // can have no template active
if (is_array($genallowed)) $modellist = $genallowed;
else {
include_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
@ -577,6 +578,7 @@ class FormFile
}
} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice')
{
$showempty = 1; // can have no template active
if (is_array($genallowed)) $modellist = $genallowed;
else {
include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';

View File

@ -113,7 +113,12 @@ class Translate
} else $srclang = strtolower($langpart[0])."_".strtoupper($langpart[0]);
} else { // If it's for a codetouse that is a short code xx
// Array to convert short lang code into long code.
$longforshort = array('ar'=>'ar_SA', 'el'=>'el_GR', 'ca'=>'ca_ES', 'en'=>'en_US', 'ja'=>'ja_JP', 'nb'=>'nb_NO', 'no'=>'nb_NO');
$longforshort = array(
'am'=>'am_ET', 'ar'=>'ar_SA', 'bn'=>'bn_DB', 'el'=>'el_GR', 'ca'=>'ca_ES', 'cs'=>'cs_CZ', 'en'=>'en_US', 'fa'=>'fa_IR',
'gl'=>'gl_ES', 'he'=>'he_IL', 'hi'=>'hi_IN', 'ja'=>'ja_JP',
'ka'=>'ka_GE', 'km'=>'km_KH', 'kn'=>'kn_IN', 'ko'=>'ko_KR', 'lo'=>'lo_LA', 'nb'=>'nb_NO', 'no'=>'nb_NO', 'ne'=>'ne_NP',
'sl'=>'sl_SI', 'sq'=>'sq_AL', 'sr'=>'sr_RS', 'sv'=>'sv_SE', 'uk'=>'uk_UA', 'vi'=>'vi_VN', 'zh'=>'zh_CN'
);
if (isset($longforshort[strtolower($langpart[0])])) $srclang = $longforshort[strtolower($langpart[0])];
elseif (!empty($langpart[0])) $srclang = strtolower($langpart[0])."_".strtoupper($langpart[0]);
else $srclang = 'en_US';

View File

@ -62,13 +62,16 @@ class Utils
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if (empty($choices)) $choices = 'tempfilesold,logfiles';
if (empty($choices)) {
$choices = 'tempfilesold+logfiles';
}
dol_syslog("Utils::purgeFiles choice=".$choices, LOG_DEBUG);
$count = 0;
$countdeleted = 0;
$counterror = 0;
$filelog = '';
$choicesarray = preg_split('/[\+,]/', $choices);
foreach ($choicesarray as $choice) {
@ -109,7 +112,6 @@ class Utils
$filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1);
}
$filelog = '';
if (!empty($conf->syslog->enabled))
{
$filelog = $conf->global->SYSLOG_FILE;
@ -143,8 +145,7 @@ class Utils
if ($filesarray[$key]['fullname'] != $filelog || $choice == 'logfile' || $choice == 'logfiles')
{
$result = dol_delete_file($filesarray[$key]['fullname'], 1, 1);
if ($result)
{
if ($result) {
$count++;
$countdeleted++;
} else {
@ -166,7 +167,9 @@ class Utils
if ($count > 0) {
$this->output = $langs->trans("PurgeNDirectoriesDeleted", $countdeleted);
if ($count > $countdeleted) $this->output .= '<br>'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted));
if ($count > $countdeleted) {
$this->output .= '<br>'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted));
}
} else {
$this->output = $langs->trans("PurgeNothingToDelete").(in_array('tempfilesold', $choicesarray) ? ' (older than 24h for temp files)' : '');
}

View File

@ -137,9 +137,10 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
update: update, textarea: textarea,
pbq: item.pbq,
type: item.type, qty: item.qty, discount: item.discount,
pricebasetype: item.pricebasetype, price_ht: item.price_ht,
pricebasetype: item.pricebasetype,
price_ht: item.price_ht,
price_ttc: item.price_ttc,
up: item.up, description : item.description,
description : item.description,
ref_customer: item.ref_customer }
}));
}
@ -152,32 +153,24 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
console.log("We will trigger change on input '.$htmlname.' because of the select definition of autocomplete code for input#search_'.$htmlname.'");
console.log("Selected id = "+ui.item.id+" - If this value is null, it means you select a record with key that is null so selection is not effective");
console.log("Propagate before some properties");
console.log("Propagate before some properties retrieved by ajax into data-xxx properties");
//console.log(ui.item);
//For supplier price
$("#'.$htmlname.'").attr("data-up", ui.item.up);
$("#'.$htmlname.'").attr("data-discount", ui.item.discount);
// For supplier price and customer when price by quantity is off
$("#'.$htmlname.'").attr("data-up", ui.item.price_ht);
$("#'.$htmlname.'").attr("data-base", ui.item.pricebasetype);
$("#'.$htmlname.'").attr("data-qty", ui.item.qty);
$("#'.$htmlname.'").attr("data-discount", ui.item.discount);
$("#'.$htmlname.'").attr("data-description", ui.item.description);
$("#'.$htmlname.'").attr("data-ref-customer", ui.item.ref_customer);
//For customer price
';
';
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
$script .= '
$("#' . $htmlname . '").attr("data-pbq", ui.item.pbq);
$("#' . $htmlname . '").attr("data-pbqup", ui.item.price_ht);
$("#' . $htmlname . '").attr("data-pbqbase", ui.item.pricebasetype);
$("#' . $htmlname . '").attr("data-pbqqty", ui.item.qty);
$("#' . $htmlname . '").attr("data-pbqpercent", ui.item.discount);
';
} else {
$script .= '
$("#' . $htmlname . '").attr("data-up", ui.item.price_ht);
$("#' . $htmlname . '").attr("data-base", ui.item.pricebasetype);
$("#' . $htmlname . '").attr("data-qty", ui.item.qty);
$("#' . $htmlname . '").attr("data-discount", ui.item.discount);
// For customer price when PRODUIT_CUSTOMER_PRICES_BY_QTY is on
$("#'.$htmlname.'").attr("data-pbq", ui.item.pbq);
$("#'.$htmlname.'").attr("data-pbqup", ui.item.price_ht);
$("#'.$htmlname.'").attr("data-pbqbase", ui.item.pricebasetype);
$("#'.$htmlname.'").attr("data-pbqqty", ui.item.qty);
$("#'.$htmlname.'").attr("data-pbqpercent", ui.item.discount);
';
}
$script .= '
@ -217,6 +210,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
console.log("Make action update on each ui.item.update")
// loop on each "update" fields
$.each(ui.item.update, function(key, value) {
console.log("Set value "+value+" into #"+key);
$("#" + key).val(value).trigger("change");
});
}

View File

@ -70,7 +70,7 @@ function contract_prepare_head(Contrat $object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->contrat->dir_output."/".dol_sanitizeFileName($object->ref);
$upload_dir = $conf->contrat->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id;

View File

@ -1192,6 +1192,16 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
{
if ($nophperrors) $ok = @unlink($filename);
else $ok = unlink($filename);
// If it fails and it is because of the missing write permission on parent dir
if (!$ok && file_exists(dirname($filename)) && !(fileperms(dirname($filename)) & 0200)) {
dol_syslog("Error in deletion, but parent directory exists with no permission to write, we try to change permission on parent directory and retry...", LOG_DEBUG);
@chmod(dirname($filename), fileperms(dirname($filename)) | 0200);
// Now we retry deletion
if ($nophperrors) $ok = @unlink($filename);
else $ok = unlink($filename);
}
if ($ok)
{
dol_syslog("Removed file ".$filename, LOG_DEBUG);
@ -2316,10 +2326,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($fuser->rights->ficheinter->{$lire}) $accessallowed = 1;
$original_file = $conf->ficheinter->dir_output.'/'.$original_file;
} // Wrapping pour les apercu conat
elseif (($modulepart == 'apercucontract') && !empty($conf->contrat->dir_output))
elseif (($modulepart == 'apercucontract') && !empty($conf->contrat->multidir_output[$entity]))
{
if ($fuser->rights->contrat->{$lire}) $accessallowed = 1;
$original_file = $conf->contrat->dir_output.'/'.$original_file;
$original_file = $conf->contrat->multidir_output[$entity].'/'.$original_file;
} // Wrapping pour les apercu supplier proposal
elseif (($modulepart == 'apercusupplier_proposal' || $modulepart == 'apercusupplier_proposal') && !empty($conf->supplier_proposal->dir_output))
{
@ -2709,13 +2719,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
if (!empty($conf->stock->enabled)) $original_file = $conf->stock->multidir_output[$entity].'/movement/'.$original_file;
} // Wrapping pour les contrats
elseif ($modulepart == 'contract' && !empty($conf->contrat->dir_output))
elseif ($modulepart == 'contract' && !empty($conf->contrat->multidir_output[$entity]))
{
if ($fuser->rights->contrat->{$lire} || preg_match('/^specimen/i', $original_file))
{
$accessallowed = 1;
}
$original_file = $conf->contrat->dir_output.'/'.$original_file;
$original_file = $conf->contrat->multidir_output[$entity].'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."contrat WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('contract').")";
} // Wrapping pour les dons
elseif ($modulepart == 'donation' && !empty($conf->don->dir_output))

View File

@ -3232,7 +3232,7 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF
* Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
* @param string $moreatt Add more attribute on img tag (For example 'class="pictofixedwidth"')
* @param boolean|int $pictoisfullpath If true or 1, image path is a full path
* @param int $srconly Return only content of the src attribute of img.
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
@ -3265,7 +3265,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
'cash-register', 'category', 'check', 'clock', 'close_title', 'cog', 'company', 'contact', 'contract', 'cron', 'cubes',
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
@ -3273,11 +3273,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'intervention', 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot',
'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'mrp', 'note', 'next',
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert',
'object_folder', 'object_folder-open','object_generic',
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label',
'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
'object_margin', 'object_members', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
'object_lot', 'object_mrp', 'object_other',
'object_payment', 'object_pdf', 'object_product', 'object_propal',
'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
@ -3291,7 +3292,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'salary', 'supplier_invoice', 'ticket',
'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
'error', 'warning',
'recruitmentcandidature', 'recruitmentjobposition', 'resource',
'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'user-cog',
@ -3318,11 +3319,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'user-friends', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
'email'=>'at',
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle',
'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group', 'loan'=>'money-bill-alt',
'member'=>'users', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
'trip'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
'sign-out'=>'sign-out-alt',
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
@ -3370,11 +3371,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = 'fa-'.$pictowithouttext;
}
if (in_array($pictowithouttext, array('member', 'contract'))) {
$fasize = '0.92em';
if (in_array($pictowithouttext, array('holiday', 'dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) {
$morecss = 'em092';
}
if (in_array($pictowithouttext, array('intervention', 'payment', 'loan'))) {
$fasize = '0.80em';
if (in_array($pictowithouttext, array('holiday'))) {
$morecss = 'em088';
}
if (in_array($pictowithouttext, array('intervention', 'payment', 'loan', 'stock', 'technic'))) {
$morecss = 'em080';
}
// Define $marginleftonlyshort
@ -3423,7 +3427,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944',
'other'=>'#ddd',
'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba',
'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'user-cog'=>'#999', 'globe-americas'=>'#aaa',
'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'uparrow'=>'#555', 'user-cog'=>'#999', 'globe-americas'=>'#aaa',
'website'=>'#304'
);
if (isset($arrayconvpictotocolor[$pictowithouttext])) {
@ -7873,7 +7877,10 @@ function printCommonFooter($zone = 'private')
// Add property 'required' on input
print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
print 'jQuery("textarea[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
print '// required on a select works only if key is "", so we add the required attributes but also we reset the key -1 or 0 to an empty string'."\n";
print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'-1\']").prop(\'value\', \'\');'."\n";
print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'0\']").prop(\'value\', \'\');'."\n";
}
}
}
@ -8202,7 +8209,7 @@ function showDirectDownloadLink($object)
if ($url)
{
$out .= img_picto('', 'globe').' '.$langs->trans("DirectDownloadLink").'<br>';
$out .= img_picto($langs->trans("PublicDownloadLinkdesc"), 'globe').' '.$langs->trans("DirectDownloadLink").'<br>';
$out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'">';
$out .= ajax_autoselect("directdownloadlink", 0);
}

View File

@ -189,7 +189,7 @@ function invoice_rec_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/card-rec.php?id='.$object->id;
$head[$h][1] = $langs->trans("CardBill");
$head[$h][1] = $langs->trans("RepeatableInvoice");
$head[$h][2] = 'card';
$h++;

View File

@ -590,9 +590,9 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
$sql .= " WHERE dbt.rowid IN (".$objectid.")";
$sql .= " AND dbt.".$dbt_keyfield." = ".$user->socid;
} elseif (!empty($conf->societe->enabled)) {
} elseif (!empty($conf->societe->enabled) && !$user->rights->societe->client->voir) {
// If internal user: Check permission for internal users that are restricted on their objects
if ($feature != 'ticket' && !$user->rights->societe->client->voir) {
if ($feature != 'ticket') {
if (empty($dbt_keyfield)) dol_print_error('', 'Param dbt_keyfield is required but not defined');
$sql = "SELECT COUNT(sc.fk_soc) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
@ -601,9 +601,8 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
$sql .= " AND sc.fk_soc = dbt.".$dbt_keyfield;
$sql .= " AND sc.fk_user = ".$user->id;
}
// On ticket, the thirdparty is not mandatory, so we need a special test to accept record with no thirdparties.
if ($feature == 'ticket' && !$user->rights->societe->client->voir) {
} else {
// On ticket, the thirdparty is not mandatory, so we need a special test to accept record with no thirdparties.
$sql = "SELECT COUNT(dbt.".$dbt_select.") as nb";
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = dbt.".$dbt_keyfield." AND sc.fk_user = ".$user->id;

View File

@ -696,6 +696,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$substitarray = getCommonSubstitutionArray($langs, 0, null, null);
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
/**
* We update newmenu with entries found into database
* --------------------------------------------------
@ -1534,7 +1536,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if ($mainmenu == 'products') {
// Products
if (!empty($conf->product->enabled)) {
$newmenu->add("/product/index.php?leftmenu=product&amp;type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product');
$newmenu->add("/product/index.php?leftmenu=product&amp;type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"'));
$newmenu->add("/product/card.php?leftmenu=product&amp;action=create&amp;type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer);
$newmenu->add("/product/list.php?leftmenu=product&amp;type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
if (!empty($conf->stock->enabled)) {
@ -1562,7 +1564,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Services
if (!empty($conf->service->enabled)) {
$newmenu->add("/product/index.php?leftmenu=service&amp;type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
$newmenu->add("/product/index.php?leftmenu=service&amp;type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"'));
$newmenu->add("/product/card.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
$newmenu->add("/product/list.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->rights->service->lire);
if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) {
@ -1579,7 +1581,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Warehouse
if (!empty($conf->stock->enabled)) {
$langs->load("stocks");
$newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock');
$newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"'));
$newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer);
$newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->rights->stock->lire);
$newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire);
@ -1601,7 +1603,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (!empty($conf->stock->enabled)) {
$langs->load("stocks");
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock');
$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") {
$newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->creer);
$newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->lire);
@ -1619,7 +1621,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Shipments
if (!empty($conf->expedition->enabled)) {
$langs->load("sendings");
$newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings');
$newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"'));
$newmenu->add("/expedition/card.php?action=create2&amp;leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer);
$newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") {
@ -1633,7 +1635,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Receptions
if (!empty($conf->reception->enabled)) {
$langs->load("receptions");
$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions');
$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"'));
$newmenu->add("/reception/card.php?action=create2&amp;leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer);
$newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
@ -1699,7 +1701,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
}
// Project assigned to user
$newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects');
$newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="pictofixedwidth"'));
$newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer);
if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
@ -1722,7 +1724,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
// Project affected to user
$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks');
$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks', 0, '', '', '', img_picto('', 'task', 'class="pictofixedwidth"'));
$newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
$newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire);
$newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);
@ -1740,7 +1742,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (!empty($conf->hrm->enabled)) {
$langs->load("hrm");
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm');
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
$newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write);
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read);
}
@ -1750,7 +1752,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Load translation files required by the page
$langs->loadLangs(array("holiday", "trips"));
$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm');
$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'holiday', 'class="pictofixedwidth"'));
$newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->rights->holiday->write);
$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read);
if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm") {
@ -1820,14 +1822,14 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (!empty($conf->export->enabled)) {
$langs->load("exports");
$newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export');
$newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer);
//$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->rights->export->lire);
}
if (!empty($conf->import->enabled)) {
$langs->load("exports");
$newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import');
$newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run);
}
}
@ -1861,7 +1863,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=3", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
}
$newmenu->add("/adherents/index.php?leftmenu=members&amp;mainmenu=members", $langs->trans("Subscriptions"), 0, $user->rights->adherent->cotisation->lire);
$newmenu->add("/adherents/index.php?leftmenu=members&amp;mainmenu=members", $langs->trans("Subscriptions"), 0, $user->rights->adherent->cotisation->lire, '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=-1,1&amp;mainmenu=members", $langs->trans("NewSubscription"), 1, $user->rights->adherent->cotisation->creer);
$newmenu->add("/adherents/subscription/list.php?leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->cotisation->lire);
$newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire);
@ -1870,7 +1872,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
//if (! empty($conf->export->enabled) && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
// Type
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup');
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup', 0, '', '', '', img_picto('', 'members', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members&amp;action=create", $langs->trans("New"), 1, $user->rights->adherent->configurer);
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members", $langs->trans("List"), 1, $user->rights->adherent->configurer);
}

View File

@ -357,8 +357,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
*
* @param array $array_sql SQL requests to be executed when enabling module
* @param string $options String with options when disabling module:
* - 'noboxes' = Do not insert boxes
* - 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation
* - 'noboxes' = Do all actions but do not insert boxes
* - 'newboxdefonly' = Do all actions but for boxes, insert def of boxes only and not boxes activation
* @return int 1 if OK, 0 if KO
*/
protected function _init($array_sql, $options = '')
@ -389,7 +389,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$err += $this->insert_const(); // Test on newboxdefonly to avoid to erase value during upgrade
}
// Insert boxes def into llx_boxes_def and boxes setup (into llx_boxes)
// Insert boxes def (into llx_boxes_def) and boxes setup (into llx_boxes)
if (!$err && !preg_match('/noboxes/', $options)) {
$err += $this->insert_boxes($options);
}
@ -1815,7 +1815,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
// phpcs:enable
global $user;
if (!is_array($this->menu) || empty($this->menu)) { return 0;
if (!is_array($this->menu) || empty($this->menu)) {
return 0;
}
include_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
@ -2172,9 +2173,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
* The init function adds tabs, constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes')
* 'noboxes' = Do not insert boxes 'newboxdefonly' = For boxes,
* insert def of boxes only and not boxes activation
* @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes', 'menuonly')
* 'noboxes' = Do not insert boxes 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation
* @return int 1 if OK, 0 if KO
*/
public function init($options = '')

View File

@ -712,7 +712,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');

View File

@ -930,7 +930,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');

View File

@ -219,7 +219,7 @@ class doc_generic_contract_odt extends ModelePDFContract
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
if ($conf->contrat->dir_output)
if ($conf->contrat->multidir_output[$object->entity])
{
// If $object is id instead of object
if (!is_object($object))
@ -236,7 +236,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$object->fetch_thirdparty();
$dir = $conf->contrat->dir_output;
$dir = $conf->contrat->multidir_output[$object->entity];
$objectref = dol_sanitizeFileName($object->ref);
if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref;
$file = $dir."/".$objectref.".odt";

View File

@ -201,7 +201,7 @@ class pdf_strato extends ModelePDFContract
$file = $dir."/SPECIMEN.pdf";
} else {
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->contrat->dir_output."/".$objectref;
$dir = $conf->contrat->multidir_output[$object->entity]."/".$objectref;
$file = $dir."/".$objectref.".pdf";
}

View File

@ -1004,7 +1004,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');

View File

@ -1108,7 +1108,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');

View File

@ -58,7 +58,7 @@ class modECM extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of png file (without png) used for this module
$this->picto = 'folder';
$this->picto = 'folder-open';
// Data directories to create when module is enabled
$this->dirs = array("/ecm/temp");

View File

@ -188,7 +188,7 @@ class modResource extends DolibarrModules
'fk_menu'=>'fk_mainmenu=tools',
'type'=>'left',
'titre'=> 'MenuResourceIndex',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em92"'),
'mainmenu'=>'tools',
'leftmenu'=> 'resource',
'url'=> '/resource/list.php',

View File

@ -208,7 +208,7 @@ class modTicket extends DolibarrModules
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket',
'type' => 'left',
'titre' => 'Ticket',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
'mainmenu' => 'ticket',
'leftmenu' => 'ticket',
'url' => '/ticket/index.php',

View File

@ -51,7 +51,7 @@ class modWorkflow extends DolibarrModules
// 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)
$this->description = "Workflow management";
$this->description = "Inter-modules workflow management";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)

View File

@ -908,7 +908,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');

View File

@ -1048,7 +1048,7 @@ class pdf_cyan extends ModelePDFPropales
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');

View File

@ -865,7 +865,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L');

View File

@ -747,7 +747,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_id);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L');

View File

@ -807,7 +807,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
$pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L');

View File

@ -451,8 +451,10 @@ if ($action == 'confirm_crop')
*/
$title= $langs->trans("ImageEditor");
$morejs = array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js');
$morecss = array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css');
llxHeader($head, $title, '', '', 0, 0, array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js'), array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css'));
llxHeader($head, $title, '', '', 0, 0, $morejs, $morecss);
print load_fiche_titre($title);

View File

@ -169,6 +169,7 @@ $totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname];
$help = $extrafields->attributes[$elementtype]['help'][$attrname];
$entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname];
$printable = $extrafields->attributes[$elementtype]['printable'][$attrname];
$enabled = $extrafields->attributes[$elementtype]['enabled'][$attrname];
if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param))
{
@ -302,6 +303,14 @@ if (in_array($type, array_keys($typewecanchangeinto)))
<!-- Multicompany entity -->
<tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ? ' checked' : ''); ?>></td></tr>
<?php } ?>
<!-- Show Enabled property when value is not a common value -->
<?php if ($enabled != '1') { ?>
<tr class="help"><td><?php echo $langs->trans("EnabledCondition"); ?></td><td class="valeur">
<?php echo dol_escape_htmltag($enabled); ?>
<?php } ?>
</td></tr>
</table>
<?php print dol_get_fiche_end(); ?>

View File

@ -76,6 +76,11 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel
{
foreach ($extrafields->attributes[$elementtype]['type'] as $key => $value)
{
/*if (! dol_eval($extrafields->attributes[$elementtype]['enabled'][$key], 1)) {
// TODO Uncomment this to exclude extrafields of modules not enabled. Add a link to "Show extrafields disabled"
// continue;
}*/
// Load language if required
if (!empty($extrafields->attributes[$elementtype]['langfile'][$key])) {
$langs->load($extrafields->attributes[$elementtype]['langfile'][$key]);

View File

@ -1,6 +1,6 @@
<?php
print '<!-- extrafields_list_array_fields.tpl.php -->'."\n";
// This tpl file is included into the init part of pages, so before action.
// So no output must be done.
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf))

View File

@ -88,7 +88,7 @@ if ($absolute_creditnote > 0) {
}
if ($absolute_discount <= 0 || $isNewObject) {
$text .= '('.$addabsolutediscount.')';
$text .= ' ('.$addabsolutediscount.')';
}
if ($isNewObject) {

View File

@ -32,6 +32,7 @@
* $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
* $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
*/
// Protection to avoid direct call of template
if (empty($object) || !is_object($object)) {
print "Error: this template page cannot be called directly as an URL";
@ -174,7 +175,7 @@ if ($nolinesbefore) {
echo ((GETPOST('prod_entry_mode', 'alpha') == 'free' || !empty($conf->global->MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT)) ? ' checked' : '');
echo '> ';
// Show type selector
echo $langs->trans("FreeLineOfType");
echo '<span class="textradioforitem">'.$langs->trans("FreeLineOfType").'</span>';
echo '</label>';
echo ' ';
} else {
@ -193,20 +194,25 @@ if ($nolinesbefore) {
// Predefined product/service
if (!empty($conf->product->enabled) || !empty($conf->service->enabled))
{
if ($forceall >= 0 && $freelines) echo '<br>';
echo '<span class="prod_entry_mode_predef">';
if ($forceall >= 0 && $freelines) echo '<br><span class="prod_entry_mode_predef paddingtop">';
else echo '<span class="prod_entry_mode_predef">';
echo '<label for="prod_entry_mode_predef">';
echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode') == 'predef' ? ' checked' : '').'> ';
if (empty($senderissupplier))
{
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell');
elseif ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell');
else echo $langs->trans('PredefinedProductsAndServicesToSell');
$labelforradio = '';
if (empty($conf->dol_optimize_smallscreen)) {
if (empty($senderissupplier)) {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) $labelforradio = $langs->trans('PredefinedProductsToSell');
elseif ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) $labelforradio = $langs->trans('PredefinedServicesToSell');
else $labelforradio = $langs->trans('PredefinedProductsAndServicesToSell');
} else {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) $labelforradio = $langs->trans('PredefinedProductsToPurchase');
elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) $labelforradio = $langs->trans('PredefinedServicesToPurchase');
else $labelforradio = $langs->trans('PredefinedProductsAndServicesToPurchase');
}
} else {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase');
elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase');
else echo $langs->trans('PredefinedProductsAndServicesToPurchase');
$labelforradio = $langs->trans('PredefinedItem');
}
print '<span class="textradioforitem">'.$labelforradio.'</span>';
echo '</label>';
echo ' ';
$filtertype = '';
@ -239,22 +245,22 @@ if ($nolinesbefore) {
<?php
}
} else {
// $senderissupplier=2 is the same as 1 but disables test on minimum qty and disable autofill qty with minimum
// $senderissupplier=2 is the same as 1 but disables test on minimum qty, disable autofill qty with minimum and autofill unit price
if ($senderissupplier != 2)
{
$ajaxoptions = array(
'update' => array('qty'=>'qty', 'remise_percent' => 'discount', 'idprod' => 'idprod'), // html id tags that will be edited with each ajax json response key
'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo)
'update' => array('qty'=>'qty', 'remise_percent' => 'discount', 'idprod' => 'idprod'), // html id tags that will be edited with each ajax json response key
'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo)
);
$alsoproductwithnosupplierprice = 0;
} else {
$ajaxoptions = array(
'update' => array('remise_percent' => 'discount') // html id tags that will be edited with each ajax json response key
'update' => array('remise_percent' => 'discount', 'price_ht' => 'price_ht') // html id tags that will be edited with each ajax json response key
);
$alsoproductwithnosupplierprice = 1;
}
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'maxwidth500');
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'minwidth300imp maxwidth500');
if (!empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_SUPPLIER_PRODUCTS))
{
?>
@ -331,7 +337,7 @@ if ($nolinesbefore) {
{
$coldisplay++;
?>
<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth150" value="<?php echo (GETPOSTISSET("fourn_ref") ? GETPOST("fourn_ref", 'alpha', 2) : ''); ?>"></td>
<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth125" value="<?php echo (GETPOSTISSET("fourn_ref") ? GETPOST("fourn_ref", 'alpha', 2) : ''); ?>"></td>
<?php }
print '<td class="nobottom linecolvat right">';
$coldisplay++;
@ -535,47 +541,47 @@ if (!empty($usemargins) && $user->rights->margins->creer)
/* TODO This does not work for number with thousand separator that is , */
function checkFreeLine(e, npRate)
{
var buying_price = $("input[name='buying_price']:first");
var remise = $("input[name='remise_percent']:first");
var buying_price = $("input[name='buying_price']:first");
var remise = $("input[name='remise_percent']:first");
var rate = $("input[name='"+npRate+"']:first");
if (rate.val() == '')
return true;
if (! $.isNumeric(rate.val().replace(',','.')))
{
alert('<?php echo dol_escape_js($langs->trans("rateMustBeNumeric")); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
return false;
}
if (npRate == "np_markRate" && rate.val() >= 100)
{
alert('<?php echo dol_escape_js($langs->trans("markRateShouldBeLesserThan100")); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
return false;
}
var price = 0;
remisejs=price2numjs(remise.val());
if (remisejs != 100) // If a discount not 100 or no discount
{
if (remisejs == '') remisejs=0;
bpjs=price2numjs(buying_price.val());
ratejs=price2numjs(rate.val());
if (npRate == "np_marginRate")
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
else if (npRate == "np_markRate")
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
}
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
var rate = $("input[name='"+npRate+"']:first");
if (rate.val() == '')
return true;
if (! $.isNumeric(rate.val().replace(',','.')))
{
alert('<?php echo dol_escape_js($langs->trans("rateMustBeNumeric")); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
return false;
}
if (npRate == "np_markRate" && rate.val() >= 100)
{
alert('<?php echo dol_escape_js($langs->trans("markRateShouldBeLesserThan100")); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
return false;
}
var price = 0;
remisejs=price2numjs(remise.val());
if (remisejs != 100) // If a discount not 100 or no discount
{
if (remisejs == '') remisejs=0;
bpjs=price2numjs(buying_price.val());
ratejs=price2numjs(rate.val());
if (npRate == "np_marginRate")
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
else if (npRate == "np_markRate")
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
}
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
return true;
}
<?php
@ -612,28 +618,28 @@ if (!empty($usemargins) && $user->rights->margins->creer)
$("#select_type").change(function()
{
setforfree();
if (jQuery('#select_type').val() >= 0)
{
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */
jQuery('#dp_desc').focus();
/* focus if CKEDITOR */
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined")
if (jQuery('#select_type').val() >= 0)
{
var editor = CKEDITOR.instances['dp_desc'];
if (editor) { editor.focus(); }
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */
jQuery('#dp_desc').focus();
/* focus if CKEDITOR */
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined")
{
var editor = CKEDITOR.instances['dp_desc'];
if (editor) { editor.focus(); }
}
}
console.log("Hide/show date according to product type");
if (jQuery('#select_type').val() == '0')
{
jQuery('#trlinefordates').hide();
jQuery('.divlinefordates').hide();
}
else
{
jQuery('#trlinefordates').show();
jQuery('.divlinefordates').show();
}
}
console.log("Hide/show date according to product type");
if (jQuery('#select_type').val() == '0')
{
jQuery('#trlinefordates').hide();
jQuery('.divlinefordates').hide();
}
else
{
jQuery('#trlinefordates').show();
jQuery('.divlinefordates').show();
}
});
$("#prod_entry_mode_predef").on( "click", function() {
@ -652,7 +658,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
/* When changing predefined product, we reload list of supplier prices required for margin combo */
$("#idprod, #idprodfournprice").change(function()
{
console.log("Call method change() after change on #idprod or #idprodfournprice. this.val = "+$(this).val());
console.log("Call method change() after change on #idprod or #idprodfournprice (senderissupplier=<?php echo $senderissupplier; ?>). this.val = "+$(this).val());
setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva

View File

@ -53,9 +53,10 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print '<td class="linecolnum c
// Description
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
// Supplier ref
if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier')
{
print '<td class="linerefsupplier"><span id="title_fourn_ref">'.$langs->trans("SupplierRef").'</span></td>';
print '<td class="linerefsupplier maxwidth125"><span id="title_fourn_ref">'.$langs->trans("SupplierRef").'</span></td>';
}
// VAT
@ -90,6 +91,7 @@ if ($inputalsopricewithtax) print '<td class="right" style="width: 80px">'.$lang
// Qty
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
// Unit
if (!empty($conf->global->PRODUCT_USE_UNITS))
{
print '<td class="linecoluseunit left">'.$langs->trans('Unit').'</td>';
@ -104,6 +106,7 @@ if ($this->situation_cycle_ref) {
print '<td class="linecolcycleref2 right">'.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).'</td>';
}
// Purchase price
if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid))
{
if (!empty($user->rights->margins->creer))

View File

@ -654,7 +654,10 @@ class InterfaceActionsAuto extends DolibarrTriggers
if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities("ProjectModifiedInDolibarr", $object->ref);
$object->actionmsg = $langs->transnoentities("ProjectModifiedInDolibarr", $object->ref);
$object->actionmsg .= "\n".$langs->transnoentities("Task").': '.$object->ref;
//$object->actionmsg .= "\n".$langs->transnoentities("Task").': ???';
if (!empty($object->usage_opportunity) && is_object($object->oldcopy) && $object->opp_status != $object->oldcopy->opp_status) {
$object->actionmsg .= "\n".$langs->transnoentitiesnoconv("OpportunityStatus").': '.$object->oldcopy->opp_status.' -> '.$object->opp_status;
}
$object->sendtoid = 0;
}

View File

@ -47,7 +47,7 @@ class InterfaceContactRoles extends DolibarrTriggers
$this->description = "Triggers of this module auto link contact to company.";
// 'development', 'experimental', 'dolibarr' or version
$this->version = self::VERSION_DOLIBARR;
$this->picto = 'action';
$this->picto = 'company';
}
/**

View File

@ -40,7 +40,7 @@ class EcmDirectory extends CommonObject
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'dir';
public $picto = 'folder-open';
/**
* @var int ID

View File

@ -47,7 +47,7 @@ class EcmFiles extends CommonObject
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'generic';
public $picto = 'folder-open';
/**
* @var string Ref hash of file path

View File

@ -290,7 +290,7 @@ print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">';
print '<tr><td class="titlefield">'.$langs->trans("ECMCreationDate").'</td><td>';
print '<tr><td class="titlefieldcreate">'.$langs->trans("ECMCreationDate").'</td><td>';
print dol_print_date(dol_filemtime($fullpath), 'dayhour');
print '</td></tr>';
/*print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
@ -321,7 +321,9 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// Link for internal download
print '<tr><td>'.$langs->trans("DirectDownloadInternalLink").'</td><td>';
print '<tr><td>';
print $form->textwithpicto($langs->trans("DirectDownloadInternalLink"), $langs->trans("PrivateDownloadLinkDesc"));
print '</td><td>';
$modulepart = 'ecm';
$forcedownload = 1;
$rellink = '/document.php?modulepart='.$modulepart;
@ -347,9 +349,9 @@ print '</td></tr>';
// Link for direct external download
print '<tr><td>';
if ($action != 'edit') {
print $langs->trans("DirectDownloadLink");
print $form->textwithpicto($langs->trans("DirectDownloadLink"), $langs->trans("PublicDownloadLinkDesc"));
} else {
print $langs->trans("FileSharedViaALink");
print $form->textwithpicto($langs->trans("FileSharedViaALink"), $langs->trans("PublicDownloadLinkDesc"));
}
print '</td><td>';
if (!empty($object->share)) {

Some files were not shown because too many files have changed in this diff Show More