Merge pull request #15 from Dolibarr/develop

pull from develop
This commit is contained in:
Tobias Sekan 2020-04-14 07:27:13 +02:00 committed by GitHub
commit 2e0e95df85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
151 changed files with 1383 additions and 774 deletions

View File

@ -274,23 +274,23 @@ if ($action == 'create')
// Label
print '<tr><td class="tdtop">';
print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
print $form->editfieldkey("Label", 'label', $object->label, $object, 1, 'alpha:32');
print '</td><td colspan="2">';
print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
print $form->editfieldval("Label", 'label', $object->label, $object, 1, 'alpha:32');
print "</td></tr>";
// Date start
print '<tr><td>';
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker');
print '</td><td colspan="2">';
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker');
print '</td></tr>';
// Date end
print '<tr><td>';
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker');
print '</td><td colspan="2">';
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker');
print '</td></tr>';
// Statut

View File

@ -273,7 +273,7 @@ class Adherent extends CommonObject
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85),
'state_id' => array('type' => 'integer', 'label' => 'State id', 'enabled' => 1, 'visible' => -1, 'position' => 90),
'country' => array('type' => 'integer', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'position' => 95),
'country' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'position' => 95),
'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => -1, 'position' => 100),
'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 105),
'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 115),

View File

@ -425,10 +425,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information";
$modelmail = "member";
@ -950,8 +949,6 @@ print "</table>\n";
print "</div>";
print '</form>';
if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 1);
// End of page
llxFooter();
$db->close();

View File

@ -58,7 +58,7 @@ llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, arra
$title = $langs->trans("MembersStatisticsByProperties");
print load_fiche_titre($title, '');
print load_fiche_titre($title, '', 'object_group');
dol_mkdir($dir);
@ -113,7 +113,8 @@ if (!count($data))
}
else
{
print load_fiche_titre($langs->trans("MembersByNature"), '', '');
print $langs->trans("MembersByNature").'<br>';
print '<br>';
}
// Print array

View File

@ -64,7 +64,7 @@ if ($mode == 'memberbyregion') $title = $langs->trans("MembersStatisticsByRegion
llxHeader('', $title, '', '', 0, 0, $arrayjs);
print load_fiche_titre($title, $mesg);
print load_fiche_titre($title, '', 'object_group');
dol_mkdir($dir);

View File

@ -215,11 +215,11 @@ print "</tr>\n";
// Line to add new record
print "\n";
print '<tr class="oddeven"><td><input type="text" class="flat" size="24" name="constname" value="'.$constname.'"></td>'."\n";
print '<tr class="oddeven nohover"><td><input type="text" class="flat minwidth100" name="constname" value="'.$constname.'"></td>'."\n";
print '<td>';
print '<input type="text" class="flat" size="30" name="constvalue" value="'.$constvalue.'">';
print '<input type="text" class="flat minwidth100" name="constvalue" value="'.$constvalue.'">';
print '</td><td>';
print '<input type="text" class="flat" size="40" name="constnote" value="'.$constnote.'">';
print '<input type="text" class="flat minwidth100" name="constnote" value="'.$constnote.'">';
print '</td>';
print '<td>';
print '</td>';

View File

@ -28,14 +28,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
if (!$user->admin)
accessforbidden();
if (!$user->admin) {
accessforbidden();
}
// Load translation files required by the page
$langs->loadLangs(array("users", "admin", "other"));
$action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Load variable for pagination
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$securityevent = new Events($db);
$eventstolog = $securityevent->eventstolog;
@ -44,6 +56,7 @@ $eventstolog = $securityevent->eventstolog;
/*
* Actions
*/
if ($action == "save")
{
$i = 0;
@ -67,6 +80,12 @@ if ($action == "save")
* View
*/
$form = new Form($db);
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = '';
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
$wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('', $langs->trans("Audit"), $wikihelp);
@ -85,9 +104,10 @@ $head = security_prepare_head();
dol_fiche_head($head, 'audit', $langs->trans("Security"), -1);
print "<table class=\"noborder\" width=\"100%\">";
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print "<td colspan=\"2\">".$langs->trans("LogEvents")."</td>";
print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print "</tr>\n";
// Loop on each event type
foreach ($eventstolog as $key => $arr)
@ -96,10 +116,10 @@ foreach ($eventstolog as $key => $arr)
{
print '<tr class="oddeven">';
print '<td>'.$arr['id'].'</td>';
print '<td>';
print '<td class="center">';
$key = 'MAIN_LOGEVENTS_'.$arr['id'];
$value = $conf->global->$key;
print '<input class="oddeven" type="checkbox" name="'.$key.'" value="1"'.($value ? ' checked' : '').'>';
print '<input class="oddeven checkforselect" type="checkbox" name="'.$key.'" value="1"'.($value ? ' checked' : '').'>';
print '</td></tr>'."\n";
}
}
@ -109,7 +129,7 @@ dol_fiche_end();
print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
print "</div>";
print '</div>';
print "</form>\n";

View File

@ -6,6 +6,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -30,6 +31,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/rssparser.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
// Load translation files required by the page
$langs->load("admin");
@ -222,10 +224,13 @@ print '<br><div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="norss" value="'.($lastexternalrss + 1).'">';
print '</div><br><br>';
print '</div>';
print '</form>';
print '<br><br>';
print '<span class="opacitymedium">'.$langs->trans('RssNote').'</span> - <a href="'.DOL_MAIN_URL_ROOT.'/admin/boxes.php">'.$langs->trans('JumpToBoxes').'</a>';
print '<br><br>';
$sql = "SELECT rowid, file, note FROM ".MAIN_DB_PREFIX."boxes_def";
$sql .= " WHERE file = 'box_external_rss.php'";
@ -235,8 +240,9 @@ dol_syslog("select rss boxes", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$boxlist = InfoBox::listBoxes($db, 'activated', -1, null);
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
@ -252,32 +258,32 @@ if ($resql)
$result = $rssparser->parser($conf->global->$keyrssurl, 5, 300, $conf->externalrss->dir_temp);
print "<br>";
print "<form name=\"externalrssconfig\" action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">";
print '<form name="externalrssconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
print '<table class="noborder centpercent">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<table class="noborder centpercent">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
print "<tr class=\"liste_titre\">";
print '<tr class="liste_titre">';
print "<td>".$langs->trans("RSS")." ".($i + 1)."</td>";
print '<td class="right">';
print "<input type=\"submit\" class=\"button\" name=\"modify\" value=\"".$langs->trans("Modify")."\">";
print '<input type="submit" class="button buttongen" name="modify" value="'.$langs->trans("Modify").'">';
print " &nbsp; ";
print "<input type=\"submit\" class=\"button\" name=\"delete\" value=\"".$langs->trans("Delete")."\">";
print "<input type=\"hidden\" name=\"norss\" value=\"".$idrss."\">";
print '<input type="submit" class="button buttongen" name="delete" value="'.$langs->trans("Delete").'">';
print '<input type="hidden" name="norss" value="'.$idrss.'">';
print '</td>';
print "</tr>";
print "</tr>"."\n";
print '<tr class="oddeven">';
print "<td width=\"100px\">".$langs->trans("Title")."</td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_title_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrsstitle)."\"></td>";
print "</tr>";
print "</tr>"."\n";
print '<tr class="oddeven">';
print "<td>".$langs->trans("URL")."</td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_urlrss_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrssurl)."\"></td>";
print "</tr>";
print "</tr>"."\n";
print '<tr class="oddeven">';
@ -295,7 +301,7 @@ if ($resql)
print '</div>';
}
print "</td>";
print "</tr>";
print "</tr>"."\n";
// Logo
if ($result > 0 && empty($rss->error))
@ -309,12 +315,19 @@ if ($resql)
if ($imageurl) print '<img height="32" src="'.$imageurl.'">';
else print $langs->trans("None");
print '</td>';
print "</tr>";
print "</tr>"."\n";
}
print '</table>';
// Active
$active = _isInBoxList($idrss, $boxlist) ? 'yes' : 'no';
print '<tr class="oddeven">';
print '<td>'.$langs->trans('WidgetEnabled').'</td>';
print '<td>'.yn($active).'</td>';
print "</tr>"."\n";
print "</form>";
print '</table>'."\n";
print "</form>"."\n";
$i++;
}
@ -327,3 +340,23 @@ else
// End of page
llxFooter();
$db->close();
/**
* Check if the given RSS feed if inside the list of boxes/widgets
*
* @param int $idrss The id of the RSS feed
* @param array $boxlist A list with boxes/widgets
* @return bool true if the rss feed is inside the box/widget list, otherwise false
*/
function _isInBoxList($idrss, array $boxlist)
{
foreach($boxlist as $box)
{
if($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false)
{
return true;
}
}
return false;
}

View File

@ -154,8 +154,10 @@ if ($action == 'update')
//dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities

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'));
$langs->loadLangs(array('errors', 'admin', 'modulebuilder'));
$mode = GETPOST('mode', 'alpha');
$action = GETPOST('action', 'alpha');
@ -318,10 +318,13 @@ if ($mode == 'desc')
$text .= '<span class="opacitymedium">'.$langs->trans("Version").':</span> '.$version;
$moduledescriptorfile = get_class($objMod).'.class.php';
$text .= '<br><span class="opacitymedium">'.$langs->trans("DescriptorFile").':</span> '.$moduledescriptorfile;
$textexternal = '';
if ($objMod->isCoreOrExternalModule() == 'external')
{
$textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule", $dirofmodule);
$textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule").' - '.$langs->trans("InstalledInto", $dirofmodule);
if ($objMod->editor_name != 'dolibarr') $textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Publisher").':</span> '.(empty($objMod->editor_name) ? $langs->trans("Unknown") : $objMod->editor_name);
$editor_url = $objMod->editor_url;
if (!preg_match('/^http/', $editor_url)) $editor_url = 'http://'.$editor_url;

View File

@ -482,8 +482,8 @@ if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouM
print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
// Start to show page
if ($mode == 'common') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDesc")."<br></span>\n";
if ($mode == 'commonkanban') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDesc")."<br></span>\n";
if ($mode == 'common') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDesc", img_picto('', 'switch_off'))."<br></span>\n";
if ($mode == 'commonkanban') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDesc", img_picto('', 'switch_off'))."<br></span>\n";
if ($mode == 'marketplace') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesMarketPlaceDesc")."<br></span>\n";
if ($mode == 'deploy') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."<br></span>\n";
if ($mode == 'develop') print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModulesDevelopDesc")."<br></span>\n";
@ -541,8 +541,8 @@ if ($mode == 'common' || $mode == 'commonkanban')
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="floatright right">';
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="floatright right margintoponly marginrightonly" style="padding-top: 3px">'.$moreinfo.'</div>';
@ -868,7 +868,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
// Help
print '<td class="center nowrap" style="width: 82px;">';
//print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($objMod->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
print '</td>';
// Version

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Bahfir Abbes <contact@dolibarrpar.org>
* Copyright (C) 2020 Thibault FOUCART <suport@ptibogxiv.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -43,6 +44,32 @@ $action = GETPOST('action', 'aZ09');
* Actions
*/
// Action to update or add a constant
if ($action == 'update' || $action == 'add')
{
$constlineid = GETPOST('rowid', 'int');
$constname=GETPOST('constname', 'alpha');
$constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
$consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
$constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
$res=dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
if ($action == 'setvalue' && $user->admin)
{
$db->begin();
@ -149,46 +176,82 @@ $title = $langs->trans("ListOfNotificationsPerUser");
if (!empty($conf->societe->enabled)) $title = $langs->trans("ListOfNotificationsPerUserOrContact");
print load_fiche_titre($title, '', '');
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>';
/*print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>';*/
//print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
print "</tr>\n";
// Load array of available notifications
$notificationtrigger = new InterfaceNotification($db);
$listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
print '<tr class="oddeven">';
print '<td>';
$i = 0;
foreach ($listofnotifiedevents as $notifiedevent)
{
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
$elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
// Editing global variables not related to a specific theme
$constantes=array();
foreach ($listofnotifiedevents as $notifiedevent)
{
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
$elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal');
elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill');
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention');
elseif ($notifiedevent['elementtype'] == 'shipping') $elementLabel = $langs->trans('Shipping');
elseif ($notifiedevent['elementtype'] == 'expensereport') $elementLabel = $langs->trans('ExpenseReport');
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal');
elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill');
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention');
elseif ($notifiedevent['elementtype'] == 'shipping') $elementLabel = $langs->trans('Shipping');
elseif ($notifiedevent['elementtype'] == 'expensereport') $elementLabel = $langs->trans('ExpenseReport');
if ($i) print ', ';
print $label;
if ($notifiedevent['elementtype'] == 'propal') $model = 'propal_send';
elseif ($notifiedevent['elementtype'] == 'commande') $model = 'order_send';
elseif ($notifiedevent['elementtype'] == 'facture') $model = 'facture_send';
elseif ($notifiedevent['elementtype'] == 'shipping') $model = 'shipping_send';
elseif ($notifiedevent['elementtype'] == 'ficheinter') $model = 'fichinter_send';
elseif ($notifiedevent['elementtype'] == 'expensereport') $model = 'expensereport_send';
elseif ($notifiedevent['elementtype'] == 'order_supplier') $model = 'order_supplier_send';
//elseif ($notifiedevent['elementtype'] == 'invoice_supplier') $model = 'invoice_supplier_send';
elseif ($notifiedevent['elementtype'] == 'member') $model = 'member';
$i++;
$constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
}
$helptext='';
form_constantes($constantes, 0, $helptext);
} else {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>';
/*print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>';*/
//print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>';
$i = 0;
foreach ($listofnotifiedevents as $notifiedevent)
{
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
$elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal');
elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill');
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention');
elseif ($notifiedevent['elementtype'] == 'shipping') $elementLabel = $langs->trans('Shipping');
elseif ($notifiedevent['elementtype'] == 'expensereport') $elementLabel = $langs->trans('ExpenseReport');
if ($i) print ', ';
print $label;
$i++;
}
print '</td></tr>';
print '</table>';
}
print '</td></tr>';
print '</table>';
print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
print '</div>';
print '<br><br>';
@ -205,10 +268,6 @@ print '<td>'.$langs->trans("Threshold").'</td>';
print '<td>'.'</td>';
print "</tr>\n";
// Load array of available notifications
$notificationtrigger = new InterfaceNotification($db);
$listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
foreach ($listofnotifiedevents as $notifiedevent)
{
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];

View File

@ -203,7 +203,7 @@ if ($result)
// Show break line
print '<tr class="oddeven trforbreak">';
print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">';
print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName();
print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName();
print '<a name="'.$objMod->getName().'"></a>';
print '</td>';
print '<td>&nbsp;</td>';
@ -218,8 +218,6 @@ if ($result)
// Picto and label of module
print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">';
//print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName();
//print '<a name="'.$objMod->getName().'">&nbsp;</a>';
print '</td>';
// Tick

View File

@ -401,7 +401,7 @@ function getTableColumnFunction(array $functions)
* @param array $loaded A list with all loaded PHP extensions
* @param array $functions A list with all PHP functions to check
*
* @return array
* @return string
*/
function getResultColumn($name, array $activated, array $loaded, array $functions)
{

View File

@ -328,12 +328,11 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('NewAsset'), '', 'fa fa-plus-circle', dol_buildpath('/asset/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendAssetsRef";

View File

@ -253,7 +253,7 @@ if ($conf->product->enabled || $conf->product->service)
$nbno = $nbtotal = 0;
print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'products');
print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'product');
print '<br>'."\n";
$sql = "SELECT count(rowid) as nb, fk_product_type, datec";

View File

@ -256,7 +256,7 @@ jQuery(document).ready(function() {
// Part to create
if ($action == 'create')
{
print load_fiche_titre($langs->trans("NewBOM"), '', 'cubes');
print load_fiche_titre($langs->trans("NewBOM"), '', 'bom');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -440,12 +440,11 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bom/bom_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->bom->write);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bom', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendBillOfMaterialsRef";

View File

@ -144,6 +144,26 @@ class Categorie extends CommonObject
'website_page' => 'WebsitePage'
);
/**
* @var array Title Area mapping from type string
*
* @note Move to const array when PHP 5.6 will be our minimum target
*/
public static $MAP_TYPE_TITLE_AREA = array(
'product' => 'ProductsCategoriesArea',
'customer' => 'CustomersCategoriesArea',
'supplier' => 'SuppliersCategoriesArea',
'member' => 'MembersCategoriesArea',
'contact' => 'ContactsCategoriesArea',
'user' => 'UsersCategoriesArea',
'account' => 'AccountsCategoriesArea', // old for bank account
'bank_account' => 'AccountsCategoriesArea',
'project' => 'ProjectsCategoriesArea',
'warehouse'=> 'StocksCategoriesArea',
'actioncomm' => 'ActioncommCategoriesArea',
'website_page' => 'WebsitePageCategoriesArea'
);
/**
* @var array Object table mapping from type string (table llx_...) when value of key does not match table name.
*
@ -291,6 +311,7 @@ class Categorie extends CommonObject
if (!is_numeric($type)) $type = $this->MAP_ID[$type];
$sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type, ref_ext";
$sql .= ", date_creation, tms, fk_user_creat, fk_user_modif";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie";
if ($id > 0)
{
@ -315,16 +336,20 @@ class Categorie extends CommonObject
$res = $this->db->fetch_array($resql);
$this->id = $res['rowid'];
//$this->ref = $res['rowid'];
//$this->ref = $res['rowid'];
$this->fk_parent = $res['fk_parent'];
$this->label = $res['label'];
$this->description = $res['description'];
$this->color = $res['color'];
$this->socid = $res['fk_soc'];
$this->visible = $res['visible'];
$this->type = $res['type'];
$this->type = $res['type'];
$this->ref_ext = $res['ref_ext'];
$this->entity = $res['entity'];
$this->date_creation = $this->db->jdate($res['date_creation']);
$this->date_modification = $this->db->jdate($res['tms']);
$this->user_creation = $res['fk_user_creat'];
$this->user_modification = $res['fk_user_modif'];
// Retreive all extrafield
// fetch optionals attributes and labels
@ -389,7 +414,7 @@ class Categorie extends CommonObject
}
$this->db->begin();
$now = dol_now();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (";
$sql .= "fk_parent,";
$sql .= " label,";
@ -403,7 +428,9 @@ class Categorie extends CommonObject
$sql .= " type,";
$sql .= " import_key,";
$sql .= " ref_ext,";
$sql .= " entity";
$sql .= " entity,";
$sql .= " date_creation,";
$sql .= " fk_user_creat";
$sql .= ") VALUES (";
$sql .= $this->db->escape($this->fk_parent).",";
$sql .= "'".$this->db->escape($this->label)."',";
@ -417,7 +444,9 @@ class Categorie extends CommonObject
$sql .= $this->db->escape($type).",";
$sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').",";
$sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').",";
$sql .= $this->db->escape($conf->entity);
$sql .= $this->db->escape($conf->entity).",";
$sql .= "'".$this->db->idate($now)."', ";
$sql .= (int) $user->id;
$sql .= ")";
$res = $this->db->query($sql);
@ -515,6 +544,7 @@ class Categorie extends CommonObject
}
$sql .= ", visible = '".$this->db->escape($this->visible)."'";
$sql .= ", fk_parent = ".$this->fk_parent;
$sql .= ", fk_user_modif = ".(int) $user->id;
$sql .= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);

View File

@ -0,0 +1,95 @@
<?php
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/categories/info.php
* \ingroup categories
* \brief Category info page
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php';
if (!$user->rights->categorie->lire) {
accessforbidden();
}
// Load translation files required by the page
$langs->loadLangs(array('categories', 'sendings'));
$socid = 0;
$id = GETPOST('id', 'int');
// Security check
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'categorie', $id, '&category');
$object = new Categorie($db);
if (!$object->fetch($id) > 0) {
dol_print_error($db);
exit;
}
$type = $object->type;
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
/*
* View
*/
$form = new Form($db);
llxHeader('', $langs->trans('Categories'), '');
//$object->info($object->id);
$head = categories_prepare_head($object, $type);
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
dol_fiche_head($head, 'info', $langs->trans($title), -1, 'category');
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = ' type = '.$type;
$object->ref = $object->label;
$morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
$ways = $object->print_all_ways(" &gt;&gt; ", '', 1);
foreach ($ways as $way) {
$morehtmlref .= $way."<br>\n";
}
$morehtmlref .= '</div>';
dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type='.$type, 0, '', '', 1);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table width="100%"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
dol_fiche_end();
// End of page
llxFooter();
$db->close();

View File

@ -112,20 +112,12 @@ $formother = new FormOther($db);
if ($object->id)
{
if ($type == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoryShort");
elseif ($type == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoryShort");
elseif ($type == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersCategoryShort");
elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoryShort");
elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort");
elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort");
elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort");
else $title = $langs->trans("Category");
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
$head = categories_prepare_head($object, $type);
dol_fiche_head($head, 'photos', $title, -1, 'category');
dol_fiche_head($head, 'photos', $langs->trans($title), -1, 'category');
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = ' type = '.$object->type;

View File

@ -173,15 +173,7 @@ $form = new Form($db);
$formadmin = new FormAdmin($db);
$formother = new FormOther($db);
if ($type == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoryShort");
elseif ($type == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoryShort");
elseif ($type == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersCategoryShort");
elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoryShort");
elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort");
elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort");
elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort");
else $title = $langs->trans("Category");
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
$head = categories_prepare_head($object, $type);
@ -195,7 +187,7 @@ if (!empty($object->multilangs))
}
}
dol_fiche_head($head, 'translation', $title, -1, 'category');
dol_fiche_head($head, 'translation', $langs->trans($title), -1, 'category');
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = ' type = '.$object->type;

View File

@ -207,21 +207,12 @@ $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css
$helpurl = '';
llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss);
if ($type == Categorie::TYPE_PRODUCT) { $title = $langs->trans("ProductsCategoriesArea"); $typetext = 'product'; }
elseif ($type == Categorie::TYPE_SUPPLIER) { $title = $langs->trans("SuppliersCategoriesArea"); $typetext = 'supplier'; }
elseif ($type == Categorie::TYPE_CUSTOMER) { $title = $langs->trans("CustomersCategoriesArea"); $typetext = 'customer'; }
elseif ($type == Categorie::TYPE_MEMBER) { $title = $langs->trans("MembersCategoriesArea"); $typetext = 'member'; }
elseif ($type == Categorie::TYPE_CONTACT) { $title = $langs->trans("ContactsCategoriesArea"); $typetext = 'contact'; }
elseif ($type == Categorie::TYPE_ACCOUNT) { $title = $langs->trans("AccountsCategoriesArea"); $typetext = 'bank_account'; }
elseif ($type == Categorie::TYPE_PROJECT) { $title = $langs->trans("ProjectsCategoriesArea"); $typetext = 'project'; }
elseif ($type == Categorie::TYPE_USER) { $title = $langs->trans("UsersCategoriesArea"); $typetext = 'user'; }
elseif ($type == Categorie::TYPE_WAREHOUSE) { $title = $langs->trans("StocksCategoriesArea"); $typetext = 'warehouse'; }
else { $title = $langs->trans("CategoriesArea"); $typetext = 'unknown'; }
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
$head = categories_prepare_head($object, $type);
dol_fiche_head($head, 'card', $title, -1, 'category');
dol_fiche_head($head, 'card', $langs->trans($title), -1, 'category');
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = ' type = '.$object->type;
@ -350,7 +341,7 @@ else
{
$categstatic = new Categorie($db);
$fulltree = $categstatic->get_full_arbo($typetext, $object->id, 1);
$fulltree = $categstatic->get_full_arbo($type, $object->id, 1);
// Load possible missing includes
if ($conf->global->CATEGORY_SHOW_COUNTS)

View File

@ -5,7 +5,7 @@
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 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
@ -898,25 +898,29 @@ class ActionComm extends CommonObject
$error = 0;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
$sql .= " WHERE id=".$this->id;
// remove categorie association
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm";
$sql .= " WHERE fk_actioncomm=".$this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res = $this->db->query($sql);
if ($res < 0) {
$this->error = $this->db->lasterror();
$error++;
$res = $this->db->query($sql);
if (!$res) {
$this->error = $this->db->lasterror();
$error++;
}
}
// remove actioncomm_resources
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql .= " WHERE fk_actioncomm=".$this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res = $this->db->query($sql);
if ($res < 0) {
if (!$res) {
$this->error = $this->db->lasterror();
$error++;
}
@ -924,7 +928,7 @@ class ActionComm extends CommonObject
// Removed extrafields
if (!$error) {
$result = $this->deleteExtraFields();
$result = $this->deleteExtraFields();
if ($result < 0)
{
$error++;
@ -932,6 +936,18 @@ class ActionComm extends CommonObject
}
}
// remove actioncomm
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
$sql .= " WHERE id=".$this->id;
$res = $this->db->query($sql);
if (!$res) {
$this->error = $this->db->lasterror();
$error++;
}
}
if (!$error)
{
if (!$notrigger)
@ -1381,7 +1397,7 @@ class ActionComm extends CommonObject
if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL');
}
$tooltip = '<u>'.$langs->trans('ShowAction').'</u>';
$tooltip = '<u>'.$langs->trans('Action').'</u>';
if (!empty($this->ref))
$tooltip .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($label))

View File

@ -382,7 +382,6 @@ if ($resql)
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
$nav = '';
@ -443,7 +442,7 @@ if ($resql)
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));
}
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit);
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = '';

View File

@ -34,6 +34,7 @@ $result = restrictedArea($user, 'mailing');
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$optioncss = GETPOST('optioncss', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
@ -129,8 +130,6 @@ if ($filteremail)
if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')";
if (!$sortorder) $sortorder = "ASC";
if (!$sortfield) $sortfield = "m.rowid";
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($conf->liste_limit + 1, $offset);
}
else
{
@ -141,15 +140,30 @@ else
if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')";
if (!$sortorder) $sortorder = "ASC";
if (!$sortfield) $sortfield = "m.rowid";
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($conf->liste_limit + 1, $offset);
}
//print $sql;
$result = $db->query($sql);
if ($result)
$sql .= $db->order($sortfield, $sortorder);
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$num = $db->num_rows($result);
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
$offset = 0;
}
}
$sql .= $db->plimit($limit + 1, $offset);
//print $sql;
dol_syslog("comm/mailing/list.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$title = $langs->trans("ListOfEMailings");
if ($filteremail) $title .= ' ('.$langs->trans("SentTo", $filteremail).')';
@ -163,17 +177,18 @@ if ($result)
$i = 0;
$param = "&search_all=".urlencode($search_all);
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($filteremail) $param .= '&filteremail='.urlencode($filteremail);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, '', 'generic', 0, $newcardbutton);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = '';
@ -214,12 +229,12 @@ if ($result)
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
$obj = $db->fetch_object($resql);
$email->id = $obj->rowid;
$email->ref = $obj->rowid;
print "<tr>";
print '<tr class="oddeven">';
print '<td>';
print $email->getNomUrl(1);
@ -280,7 +295,8 @@ if ($result)
print '</table>';
print '</div>';
print '</form>';
$db->free($result);
$db->free($resql);
}
else
{

View File

@ -1513,7 +1513,6 @@ if ($action == 'create')
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : 0);
$ref_client = (!empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_int = (!empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
$soc = $objectsrc->thirdparty;

View File

@ -258,7 +258,6 @@ class Propal extends CommonObject
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20),
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40),
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>45), // deprecated
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>23),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>24),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),

View File

@ -494,10 +494,9 @@ if ($resql)
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendPropalRef";
$modelmail = "proposal_send";

View File

@ -499,13 +499,11 @@ if ($resql)
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendOrderRef";
$modelmail = "order_send";

View File

@ -169,7 +169,6 @@ if (($action == 'create' || $action == 'add') && !$error)
$object->note_public = trim($_POST['note_public']);
$object->note = trim($_POST['note']);
$object->ref_client = $_POST['ref_client'];
$object->ref_int = $_POST['ref_int'];
$object->modelpdf = $_POST['model'];
$object->fk_project = $_POST['projectid'];
$object->cond_reglement_id = ($_POST['type'] == 3 ? 1 : $_POST['cond_reglement_id']);
@ -407,8 +406,6 @@ if ($action == 'create' && !$error)
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
print '<input name="ref" type="hidden" value="provisoire">';
print '<input name="ref_client" type="hidden" value="'.$ref_client.'">';
print '<input name="ref_int" type="hidden" value="'.$ref_int.'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
print '<input type="hidden" name="autocloseorders" value="'.GETPOST('autocloseorders').'">';

View File

@ -1187,7 +1187,13 @@ if ($resql)
$reg = array();
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthee on tente recherche de traduction
if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) print $langs->trans($reg[1]);
else print dol_trunc($objp->label, 40);
else {
if ($objp->label == '(payment_salary)') {
print dol_trunc($langs->trans("SalaryPayment", 40));
} else {
print dol_trunc($objp->label, 40);
}
}
//print "</a>&nbsp;";
// Add links after description
@ -1195,6 +1201,7 @@ if ($resql)
$cachebankaccount = array();
foreach ($links as $key=>$val)
{
print '<!-- '.$links[$key]['type'].' -->';
if ($links[$key]['type'] == 'withdraw')
{
$banktransferstatic->id = $links[$key]['url_id'];
@ -1540,7 +1547,7 @@ if ($resql)
if ($user->rights->banque->modifier)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&amp;rowid='.$objp->rowid.'&amp;id='.$objp->bankid.'&amp;page='.$page.'">';
print img_delete();
print img_delete('', 'class="marginleftonly"');
print '</a>';
}
}

View File

@ -214,6 +214,76 @@ class Account extends CommonObject
*/
public $date_solde;
/**
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
* 'label' the translation key.
* 'enabled' is a condition when the field must be managed.
* 'position' is the sort order of field.
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'noteditable' says if field is not editable (1 or 0)
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
* 'help' is a string visible as a tooltip on field
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
*
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
*/
// BEGIN MODULEBUILDER PROPERTIES
/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'ref' =>array('type'=>'varchar(12)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25),
'label' =>array('type'=>'varchar(30)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>35, 'index'=>1),
'bank' =>array('type'=>'varchar(60)', 'label'=>'Bank', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
'code_banque' =>array('type'=>'varchar(128)', 'label'=>'Code banque', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
'code_guichet' =>array('type'=>'varchar(6)', 'label'=>'Code guichet', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
'number' =>array('type'=>'varchar(255)', 'label'=>'Number', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
'cle_rib' =>array('type'=>'varchar(5)', 'label'=>'Cle rib', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
'bic' =>array('type'=>'varchar(11)', 'label'=>'Bic', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
'iban_prefix' =>array('type'=>'varchar(34)', 'label'=>'Iban prefix', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
'country_iban' =>array('type'=>'varchar(2)', 'label'=>'Country iban', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
'cle_iban' =>array('type'=>'varchar(2)', 'label'=>'Cle iban', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
'domiciliation' =>array('type'=>'varchar(255)', 'label'=>'Domiciliation', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
'state_id' =>array('type'=>'integer', 'label'=>'State id', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>95),
'proprio' =>array('type'=>'varchar(60)', 'label'=>'Proprio', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
'owner_address' =>array('type'=>'text', 'label'=>'Owner address', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
'courant' =>array('type'=>'smallint(6)', 'label'=>'Courant', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>110),
'clos' =>array('type'=>'smallint(6)', 'label'=>'Clos', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>115),
'rappro' =>array('type'=>'smallint(6)', 'label'=>'Rappro', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
'url' =>array('type'=>'varchar(128)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
'account_number' =>array('type'=>'varchar(32)', 'label'=>'Account number', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
'accountancy_journal' =>array('type'=>'varchar(20)', 'label'=>'Accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
'currency_code' =>array('type'=>'varchar(3)', 'label'=>'Currency code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>140),
'min_allowed' =>array('type'=>'integer', 'label'=>'Min allowed', 'enabled'=>1, 'visible'=>-1, 'position'=>145),
'min_desired' =>array('type'=>'integer', 'label'=>'Min desired', 'enabled'=>1, 'visible'=>-1, 'position'=>150),
'comment' =>array('type'=>'text', 'label'=>'Comment', 'enabled'=>1, 'visible'=>-1, 'position'=>155),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>156),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>157),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>160),
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>165),
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170),
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>175),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>180),
'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Fk accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
);
// END MODULEBUILDER PROPERTIES
/**
* Current account
*/

View File

@ -386,7 +386,7 @@ if ($result)
print '</a>';
}
elseif ($links[$key]['type'] == 'payment_salary') {
print '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$links[$key]['url_id'].'">';
print '<a href="'.DOL_URL_ROOT.'/salaries/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowPaymentSalary'), 'payment').' ';
print $langs->trans("SalaryPayment");
print '</a>';

View File

@ -333,14 +333,13 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$permforcashfence = 1;
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permforcashfence);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendCashControlRef";

View File

@ -439,9 +439,9 @@ elseif ($id)
// Type
print '<tr><td>';
print $form->editfieldkey("Type", 'type', $langs->trans($object->type), $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'select:types_fees');
print $form->editfieldkey("Type", 'type', $langs->trans($object->type), $object, $user->rights->deplacement->creer, 'select:types_fees');
print '</td><td>';
print $form->editfieldval("Type", 'type', $form->cache_types_fees[$object->type], $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'select:types_fees');
print $form->editfieldval("Type", 'type', $form->cache_types_fees[$object->type], $object, $user->rights->deplacement->creer, 'select:types_fees');
print '</td></tr>';
// Who
@ -453,16 +453,16 @@ elseif ($id)
// Date
print '<tr><td>';
print $form->editfieldkey("Date", 'dated', $object->date, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'datepicker');
print $form->editfieldkey("Date", 'dated', $object->date, $object, $user->rights->deplacement->creer, 'datepicker');
print '</td><td>';
print $form->editfieldval("Date", 'dated', $object->date, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'datepicker');
print $form->editfieldval("Date", 'dated', $object->date, $object, $user->rights->deplacement->creer, 'datepicker');
print '</td></tr>';
// Km/Price
print '<tr><td class="tdtop">';
print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'numeric:6');
print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $user->rights->deplacement->creer, 'numeric:6');
print '</td><td>';
print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'numeric:6');
print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $user->rights->deplacement->creer, 'numeric:6');
print "</td></tr>";
// Where

View File

@ -6,7 +6,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017-2020 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
@ -69,6 +69,11 @@ class FactureRec extends CommonInvoice
*/
public $entity;
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'titre';
public $number;
public $date;
public $remise;
@ -82,7 +87,14 @@ class FactureRec extends CommonInvoice
public $nb_gen_done;
public $nb_gen_max;
/**
* @var int Frequency
*/
public $frequency;
/**
* @var string Unit frequency
*/
public $unit_frequency;
public $rang;
@ -122,7 +134,7 @@ class FactureRec extends CommonInvoice
*/
public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'titre' =>array('type'=>'varchar(100)', 'label'=>'Titre', 'enabled'=>1, 'visible'=>-1, 'position'=>15),
'titre' =>array('type'=>'varchar(100)', 'label'=>'Titre', 'enabled'=>1, 'showoncombobox' => 1, 'visible'=>-1, 'position'=>15),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
@ -463,10 +475,9 @@ class FactureRec extends CommonInvoice
* @param int $rowid Id of object to load
* @param string $ref Reference of recurring invoice
* @param string $ref_ext External reference of invoice
* @param int $ref_int Internal reference of other object
* @return int >0 if OK, <0 if KO, 0 if not found
*/
public function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '')
public function fetch($rowid, $ref = '', $ref_ext = '')
{
$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc';
$sql .= ', f.remise_percent, f.remise_absolue, f.remise';

View File

@ -688,11 +688,10 @@ if ($resql)
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendBillRef";
$modelmail = "facture_send";

View File

@ -546,8 +546,8 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->
// Last donations
if (!empty($conf->don->enabled) && $user->rights->societe->lire)
// Latest donations
if (!empty($conf->don->enabled) && $user->rights->don->lire)
{
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';

View File

@ -357,11 +357,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
// Invoice with Paypal transaction
// TODO add hook possibility (regis)
if (!empty($conf->paypalplus->enabled) && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && !empty($facture->ref_int))
// TODO add hook here
if (!empty($conf->paypalplus->enabled) && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && !empty($facture->ref_ext))
{
if (!empty($conf->global->PAYPAL_BANK_ACCOUNT)) $accountid = $conf->global->PAYPAL_BANK_ACCOUNT;
$paymentnum = $facture->ref_int;
$paymentnum = $facture->ref_ext;
}
// Add realtime total information

View File

@ -239,6 +239,7 @@ if ($modecompta == 'CREANCES-DETTES')
}
$sql .= " WHERE l.fk_facture = f.rowid";
$sql .= " AND f.fk_statut in (1,2)";
$sql .= " AND l.product_type in (0,1)";
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND f.type IN (0,1,2,5)";
} else {

View File

@ -1295,7 +1295,7 @@ class Contact extends CommonObject
$label .= '</div><div style="clear: both;"></div>';
}
$label .= '<u>'.$langs->trans("ShowContact").'</u>';
$label .= '<u>'.$langs->trans("Contact").'</u>';
$label .= '<br><b>'.$langs->trans("Name").':</b> '.$this->getFullName($langs);
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
if (!empty($this->poste)) $label .= '<br><b>'.$langs->trans("Poste").':</b> '.$this->poste;
@ -1348,7 +1348,7 @@ class Contact extends CommonObject
}
$result .= $linkstart;
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip valigntextbottom"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs));
$result .= $linkend;

View File

@ -382,10 +382,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'commercial', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendContractRef";
$modelmail = "contract";

View File

@ -39,9 +39,13 @@ $element = GETPOST('element', 'alpha');
$object = new GenericObject($db);
// Security check
if (!empty($user->socid))
if (!empty($user->socid)) {
$socid = $user->socid;
}
if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set');
}
/*
@ -52,20 +56,24 @@ top_httphead();
print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
if ($element == 'societe' && in_array($field, array('status')))
{
$result = restrictedArea($user, 'societe', $id);
if (in_array($field, array('status'))) {
$result = restrictedArea($user, $element, $id);
}
elseif ($element == 'product' && in_array($field, array('tosell', 'tobuy', 'tobatch')))
{
elseif ($element == 'product' && in_array($field, array('tosell', 'tobuy', 'tobatch'))) { // Special case for products
$result = restrictedArea($user, 'produit|service', $id, 'product&product', '', '', 'rowid');
}
else
{
else {
accessforbidden("Bad value for combination of parameters element/field.", 0, 0, 1);
exit;
}
// Registering new values
if (($action == 'set') && !empty($id))
$object->setValueFrom($field, $value, $element, $id);
if (($action == 'set') && !empty($id)) {
$triggerkey = strtoupper($element).'_UPDATE';
// Special case
if ($triggerkey == 'SOCIETE_UPDATE') {
$triggerkey = 'COMPANY_UPDATE';
}
$object->setValueFrom($field, $value, $element, $id, $user, $triggerkey);
}

View File

@ -157,7 +157,6 @@ class Ccountry // extends CommonObject
*/
public function fetch($id, $code = '', $code_iso = '')
{
global $langs;
$sql = "SELECT";
$sql .= " t.rowid,";
$sql .= " t.code,";

View File

@ -149,7 +149,7 @@ class HookManager
$parameters['context'] = join(':', $this->contextarray);
//dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']);
// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray).
// Define type of hook ('output' or 'addreplace'). Type 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray).
$hooktype = 'output';
if (in_array(
$method,
@ -199,6 +199,7 @@ class HookManager
'pdf_getlinetotalwithtax',
'paymentsupplierinvoices',
'printAddress',
'printEmail',
'printSearchForm',
'printTabsHead',
'printObjectLine',

View File

@ -2354,6 +2354,8 @@ class Form
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
$num = $this->db->num_rows($result);
$events = null;
@ -2882,6 +2884,7 @@ class Form
if ($result)
{
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
$num = $this->db->num_rows($result);
@ -6117,6 +6120,12 @@ class Form
}
if ($tmpfieldstoshow) $fieldstoshow = $tmpfieldstoshow;
}
else
{
// For backward compatibility
$objecttmp->fields['ref'] = array('type'=>'varchar(30)', 'label'=>'Ref', 'showoncombobox'=>1);
}
if (empty($fieldstoshow))
{
if (isset($objecttmp->fields['ref'])) {
@ -7788,7 +7797,7 @@ class Form
$(document).ready(function() {
$("#checkallactions'.$id.'").click(function() {
if($(this).is(\':checked\')){
console.log("We check all");
console.log("We check all '.$cssclass.'");
$(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\');
}
else

View File

@ -110,7 +110,7 @@ class FormFile
$maxlength = $size;
$out = "\n\n<!-- Start form attach new file -->\n";
$out = "\n\n".'<!-- Start form attach new file --><div class="formattachnewfile">'."\n";
if (empty($title)) $title = $langs->trans("AttachANewFile");
if ($title != 'none') $out .= load_fiche_titre($title, null, null);
@ -220,11 +220,11 @@ class FormFile
if (empty($sectionid)) $out .= '<br>';
}
$out .= "\n<!-- End form attach new file -->\n";
$out .= "\n</div><!-- End form attach new file -->\n";
if ($linkfiles)
{
$out .= "\n<!-- Start form link new url -->\n";
$out .= "\n".'<!-- Start form link new url --><div class="formlinknewurl">'."\n";
$langs->load('link');
$title = $langs->trans("LinkANewFile");
$out .= load_fiche_titre($title, null, null);
@ -260,7 +260,7 @@ class FormFile
$out .= '</form><br>';
}
$out .= "\n<!-- End form link new url -->\n";
$out .= "\n</div><!-- End form link new url -->\n";
}
$parameters = array('socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url'=>$url, 'perm'=>$perm);
@ -1174,7 +1174,7 @@ class FormFile
}
// Show list of existing files
if ((empty($useinecm) || $useinecm == 6) && $title != 'none') print load_fiche_titre($title ? $title : $langs->trans("AttachedFiles"));
if ((empty($useinecm) || $useinecm == 6) && $title != 'none') print load_fiche_titre($title ? $title : $langs->trans("AttachedFiles"), '', 'file-upload', 0, '', 'table-list-of-attached-files');
if (empty($url)) $url = $_SERVER["PHP_SELF"];
print '<!-- html.formfile::list_of_documents -->'."\n";
@ -1790,7 +1790,7 @@ class FormFile
print '<!-- listOfLinks -->'."\n";
// Show list of associated links
print load_fiche_titre($langs->trans("LinkedFiles"));
print load_fiche_titre($langs->trans("LinkedFiles"), '', 'external-link-square-alt', 0, '', 'table-list-of-links');
print '<form action="'.$_SERVER['PHP_SELF'].($param ? '?'.$param : '').'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* This tool can be included into a list page with
* Note: This tool can be included into a list page with :
* define('USE_CUSTOME_REPORT_AS_INCLUDE', 1);
* include DOL_DOCUMENT_ROOT.'/core/customreports.php';
*/
@ -214,6 +214,7 @@ if ($action == 'viewgraph') {
}
// Get all possible values of fields when a 'group by' is set, and save this into $arrayofvaluesforgroupby
// $arrayofvaluesforgroupby will be used to forge lael of each grouped series
if (is_array($search_groupby) && count($search_groupby)) {
foreach ($search_groupby as $gkey => $gval) {
$gvalwithoutprefix = preg_replace('/^[a-z]+\./', '', $gval);
@ -260,11 +261,30 @@ if (is_array($search_groupby) && count($search_groupby)) {
$keytouse = (string) $obj->val;
$valuetranslated = $obj->val;
}
$regs = array();
if (!empty($object->fields[$gvalwithoutprefix]['arrayofkeyval'])) {
$valuetranslated = $object->fields[$gvalwithoutprefix]['arrayofkeyval'][$obj->val];
if (is_null($valuetranslated)) $valuetranslated = $langs->transnoentitiesnoconv("UndefinedKey");
$valuetranslated = $langs->trans($valuetranslated);
}
elseif (preg_match('/integer:([^:]+):([^:]+)$/', $object->fields[$gvalwithoutprefix]['type'], $regs)) {
$classname = $regs[1];
$classpath = $regs[2];
dol_include_once($classpath);
if (class_exists($classname)) {
$tmpobject = new $classname($db);
$tmpobject->fetch($obj->val);
foreach($tmpobject->fields as $fieldkey => $field) {
if ($field['showoncombobox']) {
$valuetranslated = $tmpobject->$fieldkey;
//if ($valuetranslated == '-') $valuetranslated = $langs->transnoentitiesnoconv("Unknown")
break;
}
}
//$valuetranslated = $tmpobject->ref.'eee';
}
}
$arrayofvaluesforgroupby['g_'.$gkey][$keytouse] = $valuetranslated;
}
@ -313,7 +333,7 @@ foreach ($arrayoftype as $key => $val) {
}
}
print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1);
if (empty($conf->use_javascript_ajax)) print '<input type="submit" class="button" name="changeobjecttype" value="'.$langs->trans("Refresh").'">';
if (empty($conf->use_javascript_ajax)) print '<input type="submit" class="button buttongen" name="changeobjecttype" value="'.$langs->trans("Refresh").'">';
else {
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
@ -414,7 +434,7 @@ if ($mode == 'graph') {
print '</div>';
}
print '<div class="divadvancedsearchfield">';
print '<input type="submit" class="button" value="'.$langs->trans("Refresh").'">';
print '<input type="submit" class="button buttongen" value="'.$langs->trans("Refresh").'">';
print '</div>';
print '</div>';
print '</form>';
@ -578,6 +598,8 @@ if ($sql) {
$fieldforxkey = 'x_0';
$xlabel = $obj->$fieldforxkey;
$xvalwithoutprefix = preg_replace('/^[a-z]+\./', '', $xval);
// Define $xlabel
if (!empty($object->fields[$xvalwithoutprefix]['arrayofkeyval'])) {
$xlabel = $object->fields[$xvalwithoutprefix]['arrayofkeyval'][$obj->$fieldforxkey];
}
@ -657,6 +679,7 @@ if ($sql) {
$xlabel = $obj->$fieldforxkey;
$xvalwithoutprefix = preg_replace('/^[a-z]+\./', '', $xval);
// Define $xlabel
if (!empty($object->fields[$xvalwithoutprefix]['arrayofkeyval'])) {
$xlabel = $object->fields[$xvalwithoutprefix]['arrayofkeyval'][$obj->$fieldforxkey];
}
@ -723,7 +746,12 @@ if ($mode == 'graph') {
$px1->draw($filenamenb, $fileurlnb);
print $px1->show($totalnbofrecord ? 0 : $langs->trans("SelectYourGraphOptionsFirst"));
$texttoshow = $langs->trans("NoRecordFound");
if (! GETPOSTISSET('search_measures') || ! GETPOSTISSET('search_xaxis')) {
$texttoshow = $langs->trans("SelectYourGraphOptionsFirst");
}
print $px1->show($totalnbofrecord ? 0 : $texttoshow);
}
}

View File

@ -69,16 +69,32 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<div class="fichecenter">';
if ($conf->browser->layout == 'phone') print '<div class="fichehalfleft">';
else print '<table class="nobordernopadding" width="100%"><tr><td class="borderright">';
else print '<table class="nobordernopadding centpercent"><tr><td class="borderright">';
print '<table class="nobordernopadding centpercent">';
print '<table class="nobordernopadding centpercent tableforfield">';
if ($canedit)
{
// Type
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
print $langs->trans("Type");
print '</td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
$multiselect = 0;
if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
{
$multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
}
print '<span class="fas fa-square" style=" color: #ddd;"></span>';
print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect);
print '</td></tr>';
// Assigned to
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
print $langs->trans("ActionsToDoBy").' &nbsp; ';
print '</td><td style="padding-bottom: 2px; padding-right: 4px;">';
print img_picto('', 'user');
print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
if (empty($conf->dol_optimize_smallscreen)) print ' &nbsp; '.$langs->trans("or").' '.$langs->trans("ToUserOfGroup").' &nbsp; ';
print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit);
@ -93,23 +109,11 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
print $langs->trans("Resource");
print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">';
print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2);
print '</td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">';
print img_picto('', 'object_resource');
print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2);
print '</td></tr>';
}
// Type
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
print $langs->trans("Type");
print ' &nbsp;</td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
$multiselect = 0;
if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
{
$multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
}
print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect);
print '</td></tr>';
}
if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
@ -118,6 +122,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
print $langs->trans("ThirdParty").' &nbsp; ';
print '</td><td class="nowrap" style="padding-bottom: 2px;">';
print img_picto('', 'company');
print $form->select_company($socid, 'search_socid', '', 'SelectThirdParty', 0, 0, null, 0);
print '</td></tr>';
}
@ -131,6 +136,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<td class="nowrap" style="padding-bottom: 2px;">';
print $langs->trans("Project").' &nbsp; ';
print '</td><td class="nowrap" style="padding-bottom: 2px;">';
print img_picto('', 'project');
print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500');
print '</td></tr>';
}

View File

@ -29,7 +29,7 @@
* @param string $type Type of category
* @return array Array of tabs to show
*/
function categories_prepare_head($object, $type)
function categories_prepare_head(Categorie $object, $type)
{
global $langs, $conf, $user;
@ -57,6 +57,11 @@ function categories_prepare_head($object, $type)
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/categories/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -1228,7 +1228,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
// Edit
if ($user->rights->societe->contact->creer)
{
print '<a href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
print img_edit();
print '</a>';
}

View File

@ -1,19 +1,19 @@
<?php
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2019 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Thibault Foucart <support@ptibogxiv.net>
*
* This program is free software; you can redistribute it and/or modify
@ -1549,24 +1549,26 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
}
if (!$phototoshow) // Show No photo link (picto of pbject)
if (!$phototoshow) // Show No photo link (picto of object)
{
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">';
if ($object->element == 'action')
{
$width = 80;
$cssclass = 'photorefcenter';
$nophoto = img_picto('', 'title_agenda', '', false, 1);
$nophoto = img_picto('No photo', 'title_agenda');
}
else
{
$width = 14; $cssclass = 'photorefcenter';
$picto = $object->picto;
if ($object->element == 'project' && !$object->public) $picto = 'project'; // instead of projectpub
$nophoto = img_picto('', 'object_'.$picto, '', false, 1);
$nophoto = img_picto('No photo', 'object_'.$picto);
}
$morehtmlleft .= '<!-- No photo to show -->';
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo"'.($width ? ' style="width: '.$width.'px"' : '').' src="'.$nophoto.'"></div></div>';
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
$morehtmlleft .= $nophoto;
$morehtmlleft .= '</div></div>';
$morehtmlleft .= '</div>';
}
@ -2269,10 +2271,15 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
}
}
$rep = '<div class="nospan" style="margin-right: 10px">'.($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail.'</div>';
//$rep = '<div class="nospan" style="margin-right: 10px">';
$rep = ($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail;
//$rep .= '</div>';
if ($hookmanager) {
$parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto);
$reshook = $hookmanager->executeHooks('printEmail', $parameters, $email);
if ($reshook > 0) {
$rep = '';
}
$rep .= $hookmanager->resPrint;
}
@ -3134,13 +3141,17 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h',
'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'note',
'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email',
'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
'object_cash-register', 'object_holiday', 'object_hrm', 'object_accounting', 'object_category', 'object_multicurrency',
'object_printer', 'object_resource', 'object_technic', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other',
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip',
'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'bom', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes',
'delete', 'dolly', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'lot', 'mrp', 'note', 'stock',
'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bom',
'object_category', 'object_bookmark', 'object_bug', '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_dynamicprice',
'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment',
'object_lot', 'object_mrp', 'object_product', 'object_service', 'object_stock',
'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other',
'object_phoning', 'object_phoning_fax', 'object_email',
'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'product', 'resize', 'service', 'stats', 'trip',
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
@ -3162,20 +3173,22 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$pictowithouttext = str_replace('object_', '', $pictowithouttext);
$arrayconvpictotofa = array(
'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university',
'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', 'bom'=>'cubes',
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt',
'accounting'=>'chart-line', 'category'=>'tag',
'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt',
'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
'email'=>'at',
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle',
'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'trip'=>'wallet', 'group'=>'users',
'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users',
'sign-out'=>'sign-out-alt',
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar',
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter', 'split'=>'code-branch',
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house',
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs',
'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'stock'=>'box-open', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
'title_agenda'=>'calendar-alt',
'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'resize'=>'crop',
@ -3229,13 +3242,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Add CSS
$arrayconvpictotomorcess = array(
'action'=>'bg-infoxbox-action', 'account'=>'bg-infoxbox-bank_account', 'bank_account'=>'bg-infoxbox-bank_account', 'cash-register'=>'bg-infoxbox-bank_account',
'contract'=>'bg-infoxbox-contrat',
'multicurrency'=>'bg-infoxbox-bank_account',
'check'=>'font-status4',
'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent',
'members'=>'bg-infoxbox-adherent', 'member'=>'bg-infoxbox-adherent', 'user'=>'bg-infoxbox-adherent', 'users'=>'bg-infoxbox-adherent',
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
'holiday'=>'bg-infoxbox-holiday', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport',
'title_agenda'=>'bg-infoxbox-action',
'holiday'=>'bg-infoxbox-holiday', 'payment'=>'bg-infoxbox-bank_account', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action',
'ticket'=>'bg-infoxbox-contrat', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action',
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
);
if (!empty($arrayconvpictotomorcess[$pictowithouttext])) {
@ -3244,9 +3258,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Define $color
$arrayconvpictotocolor = array(
'address'=>'#37a', 'building'=>'#37a', 'bom'=>'#a69944',
'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'dynamicprice'=>'#a69944',
'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999',
'lot'=>'#a69944', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944',
'other'=>'#ddd',
'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444',
'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', 'rss'=>'#cba',
'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>''
);
if (isset($arrayconvpictotocolor[$pictowithouttext])) {

View File

@ -441,11 +441,13 @@ function showWebsiteTemplates(Website $website)
$colspan = 2;
$thumbsbyrow = 6;
print '<!-- For to import website template -->'."\n";
print '<table class="noborder centpercent">';
// Title
print '<tr class="liste_titre"><th class="titlefield"></th>';
print '<tr class="liste_titre"><th class="titlefield">';
print $form->textwithpicto($langs->trans("Templates"), $langs->trans("ThemeDir").' : '.join(", ", $dirthemes));
print '</th>';
print '<th class="right">';
$url = 'https://www.dolistore.com/43-web-site-templates';
print '<a href="'.$url.'" target="_blank">';
@ -453,73 +455,68 @@ function showWebsiteTemplates(Website $website)
print '</a>';
print '</th></tr>';
print '<tr>';
print '<td>'.$langs->trans("ThemeDir").'</td>';
print '<td>';
foreach ($dirthemes as $dirtheme)
{
echo '"'.$dirtheme.'" ';
}
print '</td>';
print '</tr>';
print '<tr><td colspan="'.$colspan.'">';
print '<table class="nobordernopadding" width="100%"><tr><td><div class="center">';
$i = 0;
foreach ($dirthemes as $dir)
{
//print $dirroot.$dir;exit;
$dirtheme = DOL_DATA_ROOT.$dir; // This include loop on $conf->file->dol_document_root
if (is_dir($dirtheme))
if (count($dirthemes)) {
$i = 0;
foreach ($dirthemes as $dir)
{
$handle = opendir($dirtheme);
if (is_resource($handle))
//print $dirroot.$dir;exit;
$dirtheme = DOL_DATA_ROOT.$dir; // This include loop on $conf->file->dol_document_root
if (is_dir($dirtheme))
{
while (($subdir = readdir($handle)) !== false)
$handle = opendir($dirtheme);
if (is_resource($handle))
{
if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.'
&& substr($subdir, 0, 3) <> 'CVS' && preg_match('/\.zip$/i', $subdir))
while (($subdir = readdir($handle)) !== false)
{
$subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir);
if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.'
&& substr($subdir, 0, 3) <> 'CVS' && preg_match('/\.zip$/i', $subdir))
{
$subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir);
// Disable not stable themes (dir ends with _exp or _dev)
if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) continue;
if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) continue;
// Disable not stable themes (dir ends with _exp or _dev)
if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) continue;
if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) continue;
print '<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">';
print '<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">';
$file = $dirtheme."/".$subdirwithoutzip.".jpg";
$url = DOL_URL_ROOT.'/viewimage.php?modulepart=doctemplateswebsite&file='.$subdirwithoutzip.".jpg";
$file = $dirtheme."/".$subdirwithoutzip.".jpg";
$url = DOL_URL_ROOT.'/viewimage.php?modulepart=doctemplateswebsite&file='.$subdirwithoutzip.".jpg";
if (!file_exists($file)) $url = DOL_URL_ROOT.'/public/theme/common/nophoto.png';
if (!file_exists($file)) $url = DOL_URL_ROOT.'/public/theme/common/nophoto.png';
$originalfile = basename($file);
$entity = $conf->entity;
$modulepart = 'doctemplateswebsite';
$cache = '';
$title = $file;
$originalfile = basename($file);
$entity = $conf->entity;
$modulepart = 'doctemplateswebsite';
$cache = '';
$title = $file;
$ret = '';
$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 1, '&entity='.$entity);
if (!empty($urladvanced)) $ret .= '<a class="'.$urladvanced['css'].'" target="'.$urladvanced['target'].'" mime="'.$urladvanced['mime'].'" href="'.$urladvanced['url'].'">';
else $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
print $ret;
print '<img class="img-skinthumb shadow" src="'.$url.'" border="0" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">';
print '</a>';
$ret = '';
$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 1, '&entity='.$entity);
if (!empty($urladvanced)) $ret .= '<a class="'.$urladvanced['css'].'" target="'.$urladvanced['target'].'" mime="'.$urladvanced['mime'].'" href="'.$urladvanced['url'].'">';
else $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
print $ret;
print '<img class="img-skinthumb shadow" src="'.$url.'" border="0" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">';
print '</a>';
print '<br>';
print $subdir.' ('.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).')';
print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&website='.$website->ref.'&templateuserfile='.$subdir.'" class="button">'.$langs->trans("Load").'</a>';
print '</div>';
print '<br>';
print $subdir.' ('.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).')';
print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&website='.$website->ref.'&templateuserfile='.$subdir.'" class="button">'.$langs->trans("Load").'</a>';
print '</div>';
$i++;
$i++;
}
}
}
}
}
}
else {
print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
}
print '</div></td></tr></table>';

View File

@ -2321,7 +2321,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
print '</span>'; */
print '<div class="valignmiddle inline-block">';
print '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$this->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
print '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$this->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
print '</div><br>';
print '<div class="valignmiddle inline-block info-box-actions">';

View File

@ -141,8 +141,11 @@ class CommActionRapport
$hookmanager = new HookManager($this->db);
}
$hookmanager->initHooks(array('pdfgeneration'));
$parameters = array('file'=>$file, 'outputlangs'=>$outputlangs);
global $action;
$object = new stdClass();
$parameters = array('file'=>$file, 'outputlangs'=>$outputlangs);
$reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
$pdf = pdf_getInstance($this->format);
@ -171,7 +174,7 @@ class CommActionRapport
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$nbpage = $this->_pages($pdf, $outputlangs);
$nbpage = $this->_pages($pdf, $outputlangs); // Write content
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
$pdf->Close();
@ -258,21 +261,23 @@ class CommActionRapport
// Calculate height of text
$text = '';
if (!preg_match('/^'.preg_quote($obj->label).'/', $obj->note)) $text = $obj->label."\n";
$text .= $obj->note;
$text = dol_trunc(dol_htmlentitiesbr_decode($text), 150);
if (!preg_match('/^'.preg_quote($obj->label, '/').'/', $obj->note)) $text = $obj->label."\n";
$text .= dolGetFirstLineOfText(dol_string_nohtmltag($obj->note), 2);
// Add status to text
$text .= "\n";
$status = dol_htmlentitiesbr_decode($eventstatic->getLibStatut(1, 1));
$status = $outputlangs->trans("Status").': '.dol_htmlentitiesbr_decode($eventstatic->getLibStatut(1, 1));
$text .= $status;
if ($obj->fk_project > 0)
{
$projectstatic->fetch($obj->fk_project);
$text .= ($status ? ' - ' : '').$outputlangs->transnoentitiesnoconv("Project").": ".dol_htmlentitiesbr_decode($projectstatic->getNomUrl(0, 'nolink'));
if ($projectstatic->ref) {
$text .= ($status ? ' - ' : '').$outputlangs->transnoentitiesnoconv("Project").": ".dol_htmlentitiesbr_decode($projectstatic->ref);
}
}
//print 'd'.$text; exit;
$nboflines = dol_nboflines($text);
$heightlinemax = max(2 * $height, $nboflines * $height);
// Check if there is enough space to print record
if ((1 + $y + $heightlinemax) >= ($this->page_hauteur - $this->marge_haute))
@ -294,12 +299,13 @@ class CommActionRapport
else
$textdate .= " -> ".dol_print_date($this->db->jdate($obj->dp2), "hour");
}
$pdf->MultiCell(22, $height, $textdate, 0, 'L', 0);
$textdate = $outputlangs->trans("ID").' '.$obj->id.' - '.$textdate;
$pdf->MultiCell(45 - $this->marge_gauche, $height, $textdate, 0, 'L', 0);
$y0 = $pdf->GetY();
// Third party
$pdf->SetXY(26, $y);
$pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($obj->thirdparty), 32), 0, 'L', 0);
$pdf->SetXY(45, $y);
$pdf->MultiCell(28, $height, dol_trunc($outputlangs->convToOutputCharset($obj->thirdparty), 28), 0, 'L', 0);
$y1 = $pdf->GetY();
// Action code
@ -309,7 +315,7 @@ class CommActionRapport
if ($code == 'AC_OTH') $code = 'AC_MANUAL';
if ($code == 'AC_OTH_AUTO') $code = 'AC_AUTO';
}
$pdf->SetXY(60, $y);
$pdf->SetXY(73, $y);
$labelactiontype = $outputlangs->transnoentitiesnoconv("Action".$code);
$labelactiontypeshort = $outputlangs->transnoentitiesnoconv("Action".$code.'Short');
$pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($labelactiontypeshort == "Action".$code.'Short' ? $labelactiontype : $labelactiontypeshort), 32), 0, 'L', 0);
@ -317,7 +323,7 @@ class CommActionRapport
// Description of event
$pdf->SetXY(106, $y);
$pdf->MultiCell(94, $height, $outputlangs->convToOutputCharset($text), 0, 'L', 0);
$pdf->MultiCell(94, $height, $outputlangs->convToOutputCharset(dol_string_nohtmltag($text, 0)), 0, 'L', 0);
$y3 = $pdf->GetY();
$i++;

View File

@ -6,6 +6,7 @@
* Copyright (C) 2018 Francis Appels <francis.appels@z-application.com>
* Copyright (C) 2019 Markus Welters <markus@welters.de>
* Copyright (C) 2019 Rafael Ingenleuf <ingenleuf@welters.de>
* Copyright (C) 2020 Marc Guenneugues <marc.guenneugues@simicar.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
@ -348,13 +349,21 @@ class pdf_standard extends ModeleExpenseReport
$initialY = $tab_top + 7;
$nexY = $tab_top + 7;
$showpricebeforepagebreak = 1;
$pdf->setTopMargin($tab_top_newpage);
// Loop on each lines
for ($i = 0; $i < $nblines; $i++) {
$pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage
$i = 0;
while ($i < $nblines) {
$pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage
$pdf->SetTextColor(0, 0, 0);
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it.
if (empty($showpricebeforepagebreak)) {
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
} else {
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it.
}
$pageposbefore = $pdf->getPage();
$curY = $nexY;
$pdf->startTransaction();
@ -365,7 +374,28 @@ class pdf_standard extends ModeleExpenseReport
$pdf->rollbackTransaction(true);
$pageposafter = $pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
if (empty($showpricebeforepagebreak)) {
$pdf->AddPage('', '', true);
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
$pdf->setPage($pageposafter + 1);
$showpricebeforepagebreak = 1;
$nexY = $tab_top_newpage;
$nexY += ($pdf->getFontSize() * 1.3); // Passe espace entre les lignes
$pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage
$pdf->SetTextColor(0, 0, 0);
$pdf->setTopMargin($tab_top_newpage);
continue;
} else {
$pdf->setPageOrientation('', 1, $heightforfooter);
$showpricebeforepagebreak = 0;
}
$this->printLine($pdf, $object, $i, $curY, $default_font_size, $outputlangs, $hidedetails);
$pageposafter = $pdf->getPage();
$posyafter = $pdf->GetY();
@ -394,6 +424,7 @@ class pdf_standard extends ModeleExpenseReport
{
$pdf->commitTransaction();
}
$i++;
//nexY
$nexY = $pdf->GetY();
$pageposafter = $pdf->getPage();
@ -423,6 +454,7 @@ class pdf_standard extends ModeleExpenseReport
while ($pagenb < $pageposafter)
{
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);

View File

@ -355,7 +355,24 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
// Set certificate
$cert=empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT;
// If use has no certificate, we try to take the company one
if (!$cert) {
$cert = empty($conf->global->CERTIFICATE_CRT) ? '' : $conf->global->CERTIFICATE_CRT;
}
// If a certificate is found
if ($cert) {
$info = array(
'Name' => $this->emetteur->name,
'Location' => getCountry($this->emetteur->country_code, 0),
'Reason' => 'INVOICE',
'ContactInfo' => $this->emetteur->email
);
$pdf->setSignature($cert, $cert, $this->emetteur->name, '', 2, $info);
}
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
// Set $this->atleastonediscount if you have at least one discount
for ($i = 0; $i < $nblines; $i++)

View File

@ -51,7 +51,7 @@ class modDynamicPrices extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
$this->picto = 'technic';
$this->picto = 'dynamicprice';
// Data directories to create when module is enabled
$this->dirs = array();

View File

@ -102,7 +102,7 @@ class modExpenseReport extends DolibarrModules
$r++;
// Array to add new pages in new tabs
$this->tabs[] = array('data'=>'user:+expensereport:ExpenseReport:expensereport:$user->rights->expensereport->lire:/expensereport/list.php?mainmenu=hrm&id=__ID__');
$this->tabs[] = array();
// Boxes
$this->boxes = array(); // List of boxes

View File

@ -54,7 +54,7 @@ class modFckeditor extends DolibarrModules
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of png file (without png) used for this module.
// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto = 'list';
$this->picto = 'paragraph';
// Data directories to create when module is enabled
$this->dirs = array("/medias/temp", "/medias/image");

View File

@ -57,7 +57,7 @@ class modProductBatch extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled (where dluo is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->picto = 'stock';
$this->picto = 'lot';
$this->module_parts = array();

View File

@ -62,7 +62,7 @@ class modSalaries extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->picto = 'bill';
$this->picto = 'payment';
// Data directories to create when module is enabled
$this->dirs = array("/salaries/temp");

View File

@ -158,11 +158,11 @@ class modWebsite extends DolibarrModules
$this->remove($options);
// Copy flags and octicons directory
$dirarray = array('common/flags', 'common/octicons');
foreach ($dirarray as $dir)
$dirarray = array('common/flags'=>'flags', 'common/octicons/build/svg'=>'octicons');
foreach ($dirarray as $dirfrom => $dirtarget)
{
$src = DOL_DOCUMENT_ROOT.'/theme/'.$dir;
$dest = DOL_DATA_ROOT.'/medias/image/'.$dir;
$src = DOL_DOCUMENT_ROOT.'/theme/'.$dirfrom;
$dest = DOL_DATA_ROOT.'/medias/image/'.$dirtarget;
if (is_dir($src))
{

View File

@ -451,7 +451,7 @@ class Shipments extends DolibarrApi
*/
public function delete($id)
{
if (!DolibarrApiAccess::$user->rights->shipment->supprimer) {
if (!DolibarrApiAccess::$user->rights->expedition->supprimer) {
throw new RestException(401);
}
$result = $this->shipment->fetch($id);

View File

@ -373,7 +373,6 @@ if ($resql)
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="'.($action == 'edit' ? 'update' : 'list').'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
@ -477,7 +476,7 @@ if ($resql)
$newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expensereport/card.php?action=create');
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit, 0, 0, 1);
}
$topicmail = "SendExpenseReport";

View File

@ -21,7 +21,7 @@
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
/**
* API class for fichinters
* API class for Interventions
*
* @access protected
* @class DolibarrApiAccess {@requires user,external}

View File

@ -202,7 +202,7 @@ class Fichinter extends CommonObject
{
while ($obj = $this->db->fetch_object($resql))
{
$this->nb["fichinters"] = $obj->nb;
$this->nb["interventions"] = $obj->nb;
}
$this->db->free($resql);
return 1;

View File

@ -43,6 +43,11 @@ class FichinterRec extends Fichinter
public $table_element_line = 'fichinter_rec';
public $fk_element = 'fk_fichinter';
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'titre';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/

View File

@ -329,12 +329,11 @@ if ($resql)
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="page" value="'.$page.'">';
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, 'commercial', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information";
$modelmail = "intervention";

View File

@ -1085,7 +1085,7 @@ if (empty($reshook))
if ($action == 'add' && $user->rights->fournisseur->commande->creer)
{
$error = 0;
$selectedLines = GETPOST('toselect', 'array');
if ($socid < 1)
{
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors');
@ -1177,7 +1177,7 @@ if (empty($reshook))
for ($i = 0; $i < $num; $i++)
{
if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0)
if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0 || !in_array($lines[$i]->id, $selectedLines))
continue;
$label = (!empty($lines[$i]->label) ? $lines[$i]->label : '');
@ -1755,7 +1755,7 @@ if ($action == 'create')
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
print '</div>';
print "</form>\n";
// Show origin lines
if (!empty($origin) && !empty($originid) && is_object($objectsrc))
@ -1765,10 +1765,11 @@ if ($action == 'create')
print '<table class="noborder centpercent">';
$objectsrc->printOriginLinesList();
$objectsrc->printOriginLinesList('', $selectedLines);
print '</table>';
}
print "</form>\n";
}
elseif (!empty($object->id))
{

View File

@ -671,12 +671,12 @@ if ($resql)
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendOrderRef";
$modelmail = "order_supplier_send";

View File

@ -327,8 +327,6 @@ if ($action == 'create' && !$error) {
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
print '<input name="ref" type="hidden" value="provisoire">';
print '<input name="ref_client" type="hidden" value="'.$ref_client.'">';
print '<input name="ref_int" type="hidden" value="'.$ref_int.'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
print '<input type="hidden" name="socid" value="'.$soc->id.'">';

View File

@ -523,11 +523,10 @@ if ($resql)
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print_barre_liste($langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendBillRef";
$modelmail = "invoice_supplier_send";

View File

@ -391,7 +391,6 @@ if ($resql)
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="'.($action == 'edit' ? 'update' : 'list').'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
@ -441,7 +440,7 @@ if ($resql)
$newcardbutton .= dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=request');
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1);
}
$topicmail = "Information";

View File

@ -108,7 +108,6 @@ if (!empty($conf->global->MAIN_MOTD))
* Hidden for external users
*/
$boxstatItems = array();
$boxstatFromHook = '';
@ -128,26 +127,27 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
{
// Condition to be checked for each display line dashboard
$conditions = array(
$user->rights->user->user->lire,
!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
!empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
!empty($conf->adherent->enabled) && $user->rights->adherent->lire,
!empty($conf->product->enabled) && $user->rights->produit->lire,
!empty($conf->service->enabled) && $user->rights->service->lire,
!empty($conf->propal->enabled) && $user->rights->propale->lire,
!empty($conf->commande->enabled) && $user->rights->commande->lire,
!empty($conf->facture->enabled) && $user->rights->facture->lire,
!empty($conf->contrat->enabled) && $user->rights->contrat->lire,
!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire,
!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
!empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
!empty($conf->projet->enabled) && $user->rights->projet->lire,
!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
!empty($conf->holiday->enabled) && $user->rights->holiday->read,
!empty($conf->don->enabled) && $user->rights->don->lire
$user->rights->user->user->lire,
!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
!empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
!empty($conf->adherent->enabled) && $user->rights->adherent->lire,
!empty($conf->product->enabled) && $user->rights->produit->lire,
!empty($conf->service->enabled) && $user->rights->service->lire,
!empty($conf->propal->enabled) && $user->rights->propale->lire,
!empty($conf->commande->enabled) && $user->rights->commande->lire,
!empty($conf->facture->enabled) && $user->rights->facture->lire,
!empty($conf->contrat->enabled) && $user->rights->contrat->lire,
!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire,
!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
!empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
!empty($conf->projet->enabled) && $user->rights->projet->lire,
!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
!empty($conf->holiday->enabled) && $user->rights->holiday->read,
!empty($conf->don->enabled) && $user->rights->don->lire,
!empty($conf->ticket->enabled) && $user->rights->ticket->read
);
// Class file containing the method load_state_board for each line
$includes = array(
@ -170,7 +170,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
DOL_DOCUMENT_ROOT."/projet/class/project.class.php",
DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php",
DOL_DOCUMENT_ROOT."/holiday/class/holiday.class.php",
DOL_DOCUMENT_ROOT."/don/class/don.class.php"
DOL_DOCUMENT_ROOT."/don/class/don.class.php",
DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"
);
// Name class containing the method load_state_board for each line
$classes = array('User',
@ -192,7 +193,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
'Project',
'ExpenseReport',
'Holiday',
'Don'
'Don',
'Ticket',
);
// Cle array returned by the method load_state_board for each line
$keys = array('users',
@ -206,15 +208,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
'proposals',
'orders',
'invoices',
'Contracts',
'fichinters',
'contracts',
'interventions',
'supplier_orders',
'supplier_invoices',
'askprice',
'projects',
'expensereports',
'holidays',
'donations'
'donations',
'ticket'
);
// Dashboard Icon lines
$icons = array('user',
@ -228,15 +231,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
'propal',
'order',
'bill',
'order',
'order',
'contract',
'intervention',
'order',
'bill',
'propal',
'projectpub',
'trip',
'holiday',
'generic'
'generic',
'ticket',
);
// Translation keyword
$titres = array("Users",
@ -258,7 +262,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
"Projects",
"ExpenseReports",
"Holidays",
"Donations"
"Donations",
"Ticket",
);
// Dashboard Link lines
$links = array(
@ -282,7 +287,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
DOL_URL_ROOT.'/projet/list.php?mainmenu=project',
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport',
DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&leftmenu=holiday',
DOL_URL_ROOT.'/don/list.php?leftmenu=donations'
DOL_URL_ROOT.'/don/list.php?leftmenu=donations',
DOL_URL_ROOT.'/ticket/list.php?leftmenu=ticket'
);
// Translation lang files
$langfile = array(
@ -306,12 +312,13 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
"trips",
"holiday",
"donations",
"ticket"
);
// Loop and displays each line of table
$boardloaded = array();
foreach ($keys as $key=>$val)
foreach ($keys as $key => $val)
{
if ($conditions[$key])
{
@ -331,7 +338,6 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
$board = $boardloaded[$classe];
}
if (!empty($langfile[$key])) $langs->load($langfile[$key]);
$text = $langs->trans($titres[$key]);
$boxstatItem .= '<a href="'.$links[$key].'" class="boxstatsindicator thumbstat nobold nounderline">';
@ -415,7 +421,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$dashboardlines[$board->element.'_awaiting'] = $board->load_board($user, 'awaiting');
}
// Number of services enabled (delayed)
// Number of contract / services enabled (delayed)
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$board = new Contrat($db);
@ -423,6 +429,16 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
// Number of active services (expired)
$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
}
// Number of tickets open
if (!empty($conf->ticket->enabled) && $user->rights->ticket->read) {
include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
$board = new Ticket($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
// Number of active services (expired)
//$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
}
// Number of invoices customers (has paid)
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
@ -492,7 +508,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$dashboardlines = array_merge($dashboardlines, $hookmanager->resArray);
}
/* grouping dashboard stats */
/* Open object dashboard */
$dashboardgroup = array(
'action' =>
array(
@ -526,13 +542,6 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
'stats' =>
array('facture'),
),
'contrat' =>
array(
'groupName' => 'Contracts',
'globalStatsKey' => 'Contracts',
'stats' =>
array('contrat_inactive', 'contrat_active'),
),
'supplier_proposal' =>
array(
'groupName' => 'SupplierProposals',
@ -554,7 +563,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
'stats' =>
array('invoice_supplier'),
),
'bank_account' =>
'contrat' =>
array(
'groupName' => 'Contracts',
'globalStatsKey' => 'Contracts',
'stats' =>
array('contrat_inactive', 'contrat_active'),
),
'ticket' =>
array(
'groupName' => 'Tickets',
'globalStatsKey' => 'ticket',
'stats' =>
array('ticket_opened'),
),
'bank_account' =>
array(
'groupName' => 'BankAccount',
'stats' =>
@ -587,8 +610,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$parameters = array(
'dashboardgroup' => $dashboardgroup
);
$reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object,
$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook == 0) {
$dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray);
}
@ -697,7 +719,6 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
}
}
$openedDashBoard .= '<div class="box-flex-item">'."\n";
$openedDashBoard .= ' <div class="info-box '.$openedDashBoardSize.'">'."\n";
$openedDashBoard .= ' <span class="info-box-icon bg-infoxbox-'.$groupKeyLowerCase.'">'."\n";

View File

@ -33,7 +33,7 @@ CREATE TABLE llx_blockedlog
signature varchar(100) NOT NULL,
signature_line varchar(100) NOT NULL,
object_data mediumtext,
object_version varchar(32) DEFAULT '';
object_version varchar(32) DEFAULT '',
certified integer
) ENGINE=innodb;

View File

@ -16,9 +16,9 @@
--
-- ============================================================================
ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_websitepage);
ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_website_page);
ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_websitepage);
ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_website_page);
ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_websitepage_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_websitepage_website_page_rowid FOREIGN KEY (fk_website_page) REFERENCES llx_website_page (rowid);

View File

@ -1,29 +0,0 @@
-- ========================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ========================================================================
create table llx_societe_log
(
id integer AUTO_INCREMENT PRIMARY KEY,
datel datetime,
fk_soc integer, -- Ne pas mettre de controle d'integrite sur les tables de logs
fk_statut integer, -- Ne pas mettre de controle d'integrite sur les tables de logs
fk_user integer, -- Ne pas mettre de controle d'integrite sur les tables de logs
author varchar(30),
label varchar(128)
)ENGINE=innodb;

View File

@ -477,6 +477,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_EXTERNALSITE'=>'newboxdefonly',
'MAIN_MODULE_EXPENSEREPORT'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
@ -4697,6 +4698,16 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo
$mod->init($reloadmode);
}
}
elseif ($moduletoreload == 'MAIN_MODULE_EXPENSEREPORT')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Expense Report module");
$res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modExpenseReport.class.php';
if ($res) {
$mod = new modExpenseReport($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
elseif ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module");

View File

@ -199,7 +199,7 @@ FeatureDisabledInDemo=Feature disabled in demo
FeatureAvailableOnlyOnStable=Feature only available on official stable versions
BoxesDesc=Widgets are components showing some information that you can add to personalize some pages. You can choose between showing the widget or not by selecting target page and clicking 'Activate', or by clicking the trashcan to disable it.
OnlyActiveElementsAreShown=Only elements from <a href="%s">enabled modules</a> are shown.
ModulesDesc=The modules/applications determine which features are available in the software. Some modules require permissions to be granted to users after activating the module. Click the on/off button (at end of module line) to enable/disable a module/application.
ModulesDesc=The modules/applications determine which features are available in the software. Some modules require permissions to be granted to users after activating the module. Click the on/off button <span class="small valignmiddle">%s</span> of each module to enable or disable a module/application.
ModulesMarketPlaceDesc=You can find more modules to download on external websites on the Internet...
ModulesDeployDesc=If permissions on your file system allow it, you can use this tool to deploy an external module. The module will then be visible on the tab <strong>%s</strong>.
ModulesMarketPlaces=Find external app/modules
@ -447,7 +447,8 @@ KeepEmptyToUseDefault=Keep empty to use default value
DefaultLink=Default link
SetAsDefault=Set as default
ValueOverwrittenByUserSetup=Warning, this value may be overwritten by user specific setup (each user can set his own clicktodial url)
ExternalModule=External module - Installed into directory %s
ExternalModule=External module
InstalledInto=Installed into directory %s
BarcodeInitForthird-parties=Mass barcode init for third-parties
BarcodeInitForProductsOrServices=Mass barcode init or reset for products or services
CurrentlyNWithoutBarCode=Currently, you have <strong>%s</strong> record on <strong>%s</strong> %s without barcode defined.
@ -948,7 +949,7 @@ DictionaryCanton=States/Provinces
DictionaryRegion=Regions
DictionaryCountry=Countries
DictionaryCurrency=Currencies
DictionaryCivility=Title of civility
DictionaryCivility=Honorific titles
DictionaryActions=Types of agenda events
DictionarySocialContributions=Types of social or fiscal taxes
DictionaryVAT=VAT Rates or Sales Tax Rates
@ -1990,3 +1991,5 @@ EmailTemplate=Template for email
EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax
PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF.
FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book.
RssNote=Note: Each RSS feed definition provides a widget that you must enable to have it available in dashboard
JumpToBoxes=Jump to Setup -> Widgets

View File

@ -58,8 +58,8 @@ SuppliersInvoices=Vendors invoices
SupplierBill=Vendor invoice
SupplierBills=suppliers invoices
Payment=Payment
PaymentBack=Payment back
CustomerInvoicePaymentBack=Payment back
PaymentBack=Refund
CustomerInvoicePaymentBack=Refund
Payments=Payments
PaymentsBack=Refunds
paymentInInvoiceCurrency=in invoices currency

View File

@ -325,7 +325,6 @@ CompanyDeleted=Company "%s" deleted from database.
ListOfContacts=List of contacts/addresses
ListOfContactsAddresses=List of contacts/addresses
ListOfThirdParties=List of Third Parties
ShowCompany=Show Third Party
ShowContact=Show contact
ContactsAllShort=All (No filter)
ContactType=Contact type

View File

@ -236,6 +236,7 @@ ErrorBatchNoFoundForProductInWarehouse=No lot/serial found for product "%s" in w
ErrorBatchNoFoundEnoughQuantityForProductInWarehouse=No enough quantity for this lot/serial for product "%s" in warehouse "%s".
ErrorOnlyOneFieldForGroupByIsPossible=Only 1 field for the 'Group by' is possible (others are discarded)
ErrorTooManyDifferentValueForSelectedGroupBy=Found too many different value (more than <b>%s</b>) for the field '<b>%s</b>', so we can't user it as a 'Group by' for graphics. The field 'Group By' has been removed. May be you wanted to use it as an X-Axis ?
ErrorReplaceStringEmpty=Error, the string to replace into is empty
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.

View File

@ -165,11 +165,9 @@ if ($resql)
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = '';

View File

@ -51,7 +51,7 @@ $staticmo = new Mo($db);
llxHeader('', $langs->trans("MRP"), '');
print load_fiche_titre($langs->trans("MRPArea"), '', 'cubes');
print load_fiche_titre($langs->trans("MRPArea"), '', 'mrp');
print '<div class="fichecenter"><div class="fichethirdleft">';

View File

@ -203,7 +203,7 @@ jQuery(document).ready(function() {
// Part to create
if ($action == 'create')
{
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Mo")), '', 'cubes');
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Mo")), '', 'mrp');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -306,7 +306,7 @@ if ($action == 'create')
// Part to edit record
if (($id || $ref) && $action == 'edit')
{
print load_fiche_titre($langs->trans("MO"), '', 'cubes');
print load_fiche_titre($langs->trans("MO"), '', 'mrp');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -356,12 +356,11 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/mrp/mo_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'mrp', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendMoRef";

View File

@ -250,12 +250,11 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('NewSurvey'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/opensurvey/wizard/index.php', '', $user->rights->opensurvey->write);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendOpenSurveyRef";

View File

@ -31,7 +31,7 @@ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOn
<!-- BEGIN PHP TEMPLATE -->
<?php
print load_fiche_titre($langs->trans("NewProduct"), '', 'products');
print load_fiche_titre($langs->trans("NewProduct"), '', 'product');
dol_fiche_head('');
?>

View File

@ -31,7 +31,7 @@ $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOn
<!-- BEGIN PHP TEMPLATE CREATE.TPL -->
<?php
print load_fiche_titre($langs->trans("NewService"), '', 'products');
print load_fiche_titre($langs->trans("NewService"), '', 'service');
dol_fiche_head('');
?>

View File

@ -971,10 +971,16 @@ else
print '<input type="hidden" name="barcode_auto" value="1">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if ($type == 1) $title = $langs->trans("NewService");
else $title = $langs->trans("NewProduct");
if ($type == 1) {
$picto = 'service';
$title = $langs->trans("NewService");
}
else {
$picto = 'product';
$title = $langs->trans("NewProduct");
}
$linkback = "";
print load_fiche_titre($title, $linkback, 'products');
print load_fiche_titre($title, $linkback, $picto);
dol_fiche_head('');

View File

@ -3598,11 +3598,11 @@ class Product extends CommonObject
// phpcs:enable
global $conf, $user;
$sql = "SELECT sum(c.qty), date_format(c.date_valid, '%Y%m')";
$sql = "SELECT sum(d.qty), date_format(d.date_valid, '%Y%m')";
if ($mode == 'bynumber') {
$sql .= ", count(DISTINCT c.rowid)";
}
$sql .= " FROM ".MAIN_DB_PREFIX."mrp_mo as c LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."mrp_mo as d LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON d.fk_soc = s.rowid";
if ($filteronproducttype >= 0) {
$sql .= ", ".MAIN_DB_PREFIX."product as p";
}
@ -3610,27 +3610,27 @@ class Product extends CommonObject
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE c.entity IN (".getEntity('mo').")";
$sql .= " AND c.status > 0";
$sql .= " WHERE d.entity IN (".getEntity('mo').")";
$sql .= " AND d.status > 0";
if ($this->id > 0) {
$sql .= " AND c.fk_product =".$this->id;
$sql .= " AND d.fk_product =".$this->id;
} else {
$sql .= " AND c.fk_product > 0";
$sql .= " AND d.fk_product > 0";
}
if ($filteronproducttype >= 0) {
$sql .= " AND p.rowid = c.fk_product AND p.fk_product_type =".$filteronproducttype;
$sql .= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND d.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
}
if ($socid > 0) {
$sql .= " AND c.fk_soc = ".$socid;
$sql .= " AND d.fk_soc = ".$socid;
}
$sql .= $morefilter;
$sql .= " GROUP BY date_format(c.date_valid,'%Y%m')";
$sql .= " ORDER BY date_format(c.date_valid,'%Y%m') DESC";
$sql .= " GROUP BY date_format(d.date_valid,'%Y%m')";
$sql .= " ORDER BY date_format(d.date_valid,'%Y%m') DESC";
return $this->_get_stats($sql, $mode, $year);
}
@ -4415,9 +4415,9 @@ class Product extends CommonObject
if ($maxlength) { $newref = dol_trunc($newref, $maxlength, 'middle');
}
if ($this->type == Product::TYPE_PRODUCT) { $label = '<u>'.$langs->trans("ShowProduct").'</u>';
if ($this->type == Product::TYPE_PRODUCT) { $label = '<u>'.$langs->trans("Product").'</u>';
}
if ($this->type == Product::TYPE_SERVICE) { $label = '<u>'.$langs->trans("ShowService").'</u>';
if ($this->type == Product::TYPE_SERVICE) { $label = '<u>'.$langs->trans("Service").'</u>';
}
if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('ProductRef').':</b> '.$this->ref;

View File

@ -317,6 +317,7 @@ if ($id > 0 || !empty($ref))
print load_fiche_titre($langs->trans("ProductAssociationList"), '', '');
print '<form name="formComposedProduct" action="'.$_SERVER['PHP_SELF'].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<input type="hidden" name="action" value="save_composed_product" />';
print '<input type="hidden" name="id" value="'.$id.'" />';

View File

@ -77,7 +77,7 @@ if ((isset($_GET["type"]) && $_GET["type"] == 1) || empty($conf->product->enable
llxHeader("", $langs->trans("ProductsAndServices"), $helpurl);
$linkback = "";
print load_fiche_titre($transAreaType, $linkback, 'products');
print load_fiche_titre($transAreaType, $linkback, 'product');
print '<div class="fichecenter"><div class="fichethirdleft">';

View File

@ -148,7 +148,7 @@ jQuery(document).ready(function() {
// Part to create
if ($action == 'create')
{
print load_fiche_titre($langs->trans("NewInventory"), '', 'products');
print load_fiche_titre($langs->trans("NewInventory"), '', 'product');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -183,7 +183,7 @@ if ($action == 'create')
// Part to edit record
if (($id || $ref) && $action == 'edit')
{
print load_fiche_titre($langs->trans("Inventory"), '', 'products');
print load_fiche_titre($langs->trans("Inventory"), '', 'product');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -322,7 +322,7 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/inventory/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'product', 0, $newcardbutton, '', $limit);
// Add code for pre mass action (confirmation or email presend form)
$topicmail = "Information";

View File

@ -540,7 +540,10 @@ if ($resql)
print '<input type="hidden" name="type" value="'.$type.'">';
if (empty($arrayfields['p.fk_product_type']['checked'])) print '<input type="hidden" name="search_type" value="'.dol_escape_htmltag($search_type).'">';
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit, 0, 0, 1);
$picto = 'product';
if ($type == 1) $picto = 'service';
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information";
$modelmail = "product";

View File

@ -76,7 +76,7 @@ $title = $langs->trans("Statistics");
llxHeader('', $title, $helpurl);
print load_fiche_titre($title, $mesg, 'products');
print load_fiche_titre($title, $mesg, 'product');
$param = '';

View File

@ -76,7 +76,7 @@ $title = $langs->trans("Statistics");
llxHeader('', $title, $helpurl);
print load_fiche_titre($title, $mesg, 'products');
print load_fiche_titre($title, $mesg, 'product');
$param = '';

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