Merge branch 'develop' into patch-8

This commit is contained in:
Laurent Destailleur 2020-04-12 17:07:57 +02:00 committed by GitHub
commit 51f73526f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 416 additions and 167 deletions

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

@ -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

@ -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

@ -903,40 +903,32 @@ class ActionComm extends CommonObject
$this->db->begin();
// remove categorie association
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm";
$sql .= " WHERE fk_actioncomm=".$this->id;
$res = $this->db->query($sql);
if ($res < 0) {
$this->error = $this->db->lasterror();
$error++;
}
// remove actioncomm
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
$sql .= " WHERE id=".$this->id;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm";
$sql .= " WHERE fk_actioncomm=".$this->id;
$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;
$res = $this->db->query($sql);
if ($res < 0) {
$this->error = $this->db->lasterror();
if (!$res) {
$this->error=$this->db->lasterror();
$error++;
}
}
// Removed extrafields
if (!$error) {
$result = $this->deleteExtraFields();
$result = $this->deleteExtraFields();
if ($result < 0)
{
$error++;
@ -944,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)

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

@ -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

@ -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

@ -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

@ -6117,6 +6117,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 +7794,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

@ -2269,10 +2269,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 +3139,14 @@ 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',
'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', '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',
'object_accounting', '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_holiday', 'object_hrm', 'object_multicurrency', 'object_payment',
'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other',
'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', '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',
@ -3163,6 +3169,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$arrayconvpictotofa = array(
'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university',
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase',
'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',
@ -3175,7 +3182,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'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', '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 +3236,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 +3252,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Define $color
$arrayconvpictotocolor = array(
'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999',
'address'=>'#37a', 'building'=>'#37a', 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999',
'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

@ -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

@ -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

@ -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

@ -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

@ -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';
@ -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' => 'OpenTickets',
'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);
}

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

@ -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

@ -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

@ -215,7 +215,7 @@ if ($action == "view_ticketlist")
't.date_close' => array('label' => $langs->trans("TicketCloseOn"), 'checked' => 0),
't.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1),
//'t.track_id' => array('label' => $langs->trans("IDTracking"), 'checked' => 0),
't.fk_statut' => array('label' => $langs->trans("Statut"), 'checked' => 1),
't.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1),
't.subject' => array('label' => $langs->trans("Subject"), 'checked' => 1),
'type.code' => array('label' => $langs->trans("Type"), 'checked' => 1),
'category.code' => array('label' => $langs->trans("Category"), 'checked' => 1),

View File

@ -2407,7 +2407,7 @@ class Societe extends CommonObject
// By default
if (empty($linkstart))
{
$label .= '<u>'.$langs->trans("ShowCompany").'</u>';
$label .= '<u>'.$langs->trans("ThirdParty").'</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$this->id;
}
@ -2480,7 +2480,7 @@ class Societe 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 valignmiddle"'), 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($name, $maxlen) : $name);
$result .= $linkend;

View File

@ -1148,7 +1148,7 @@ while ($i < min($num, $limit))
}
if (!empty($arrayfields['s.email']['checked']))
{
print "<td>".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18)."</td>\n";
print '<td class="tdoverflowmax150">'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)."</td>\n";
if (!$i) $totalarray['nbfield']++;
}
if (!empty($arrayfields['s.phone']['checked']))

View File

@ -2436,7 +2436,7 @@ class SupplierProposal extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Charge indicateurs this->nb de tableau de bord
* Load indicator this->nb of global stats widget
*
* @return int <0 if ko, >0 if ok
*/

View File

@ -155,7 +155,7 @@ print "</tr>\n";
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
print '<tr class="oddeven value"><td>';
print $langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector" target="_blank">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print $langs->trans("URL")." / ".$langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector" target="_blank">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print '<td colspan="2">';
print '<input type="text" size="20" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">';
print '</td></tr>';

View File

@ -31,3 +31,7 @@ tr.selected, tr.selected td {
.topnav{
background: rgb(0,0,0) !important;
}
.fa-trash {
color: #fff !important;
}

View File

@ -648,14 +648,14 @@ function MoreActions(totalactions){
if (pageactions==0){
pageactions=1;
for (i = 0; i <= totalactions; i++){
if (i<9) $("#action"+i).hide();
if (i<12) $("#action"+i).hide();
else $("#action"+i).show();
}
}
else if (pageactions==1){
pageactions=0;
for (i = 0; i <= totalactions; i++){
if (i<9) $("#action"+i).show();
if (i<12) $("#action"+i).show();
else $("#action"+i).hide();
}
}
@ -874,7 +874,8 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT)
if ($conf->global->TAKEPOS_BAR_RESTAURANT)
{
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("Receipt").'</div>', 'action'=>'TakeposPrinting(placeid);');
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("Receipt").'</div>', 'action'=>'TakeposConnector(placeid);');
else $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("Receipt").'</div>', 'action'=>'TakeposPrinting(placeid);');
} elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("Receipt").'</div>', 'action'=>'DolibarrTakeposPrinting(placeid);');
} else {
@ -935,12 +936,12 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
foreach ($menus as $menu)
{
$i++;
if (count($menus) > 9 and $i == 9)
if (count($menus) > 12 and $i == 12)
{
echo '<button style="'.$menu['style'].'" type="button" id="actionnext" class="actionbutton" onclick="MoreActions('.count($menus).');">'.$langs->trans("Next").'</button>';
echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
}
elseif ($i > 9) echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
elseif ($i > 12) echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
else echo '<button style="'.$menu['style'].'" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
}

View File

@ -344,7 +344,7 @@ if ($action == "addline")
$idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, '', '', 0, 100, '', null, 0);
}
$invoice->fetch($placeid);
$invoice->fetch($placeid);
}
if ($action == "freezone") {
@ -590,7 +590,8 @@ if ($action == "valid" || $action == "history")
}
$sectionwithinvoicelink .= '</span>';
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposConnector('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
else $sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
} elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="DolibarrTakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
} else {
@ -708,6 +709,20 @@ function TakeposPrinting(id){
});
});
}
function TakeposConnector(id){
var invoice='<?php
$data=json_encode($invoice);
$data=base64_encode($data);
echo $data;
?>';
$.ajax({
type: "POST",
url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/print.php',
data: 'invoice='+invoice
});
}
function DolibarrTakeposPrinting(id) {
console.log('Printing invoice ticket ' + id)
$.ajax({

View File

@ -1573,7 +1573,7 @@ div.nopadding {
td.nobordernopadding.widthpictotitle.col-picto {
color: var(--colortexttitlenotab);
opacity: 0.7;
opacity: 0.85;
}
.pictotitle {
margin-<?php echo $right; ?>: 8px;
@ -3826,8 +3826,8 @@ div.boximport {
.fieldrequired { font-weight: bold; color: var(--fieldrequiredcolor); }
.widthpictotitle { width: 32px; text-align: <?php echo $left; ?>; }
span.widthpictotitle { font-size: 2em; };
.widthpictotitle { width: 26px; text-align: <?php echo $left; ?>; }
span.widthpictotitle { font-size: 1.7em; };
.dolgraphtitle { margin-top: 6px; margin-bottom: 4px; }
.dolgraphtitlecssboxes { /* margin: 0px; */ }

View File

@ -77,7 +77,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
max-width: 100%;
}
.info-box-module .info-box-icon > img {
max-width: 50%;
max-width: 55%;
}
.info-box-icon-text{
@ -220,11 +220,11 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
.bg-infoxbox-order_supplier{
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#599caf', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-contrat{
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#469686', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
.bg-infoxbox-contrat, .bg-infoxbox-ticket{
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#46a676', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-bank_account{
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#c5903e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#b0a53e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-adherent{
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
@ -258,6 +258,9 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
.fa-dol-contrat:before {
content: "\f1e6";
}
.fa-dol-ticket:before {
content: "\f3ff";
}
.fa-dol-bank_account:before {
content: "\f19c";
}
@ -297,37 +300,6 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
color : #b91f1f;
}
/* USING IMAGES FOR WEATHER INTEAD OF FONT AWESOME */
/* For other themes just uncomment this part */
/*.info-box-weather-level0,
.info-box-weather-level1,
.info-box-weather-level2,
.info-box-weather-level3,
.info-box-weather-level4 {
background-position: 15px 50%;
background-repeat: no-repeat;
}
.info-box-weather .info-box-icon{
display: none !important;
}
.info-box-weather-level0 {
background-image: url("img/weather/weather-clear.png");
}
.info-box-weather-level1 {
background-image: url("img/weather/weather-few-clouds.png");
}
.info-box-weather-level2 {
background-image: url("img/weather/weather-clouds.png");
}
.info-box-weather-level3 {
background-image: url("img/weather/weather-many-clouds.png");
}
.info-box-weather-level4 {
background-image: url("img/weather/weather-storm.png");
}*/
.box-flex-container{
display: flex; /* or inline-flex */

View File

@ -61,7 +61,7 @@ span.info-box-icon-text { /* hide box text number due to problems */
max-width: 100%;
}
.info-box-module .info-box-icon > img {
max-width: 50%;
max-width: 55%;
}
.info-box-content {
padding: 5px 10px;
@ -126,11 +126,11 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
.bg-infoxbox-order_supplier i.fa{
color: <?php print colorAgressiveness('#40b0cf', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-contrat i.fa{
.bg-infoxbox-contrat i.fa, .bg-infoxbox-ticket i.fa{
color: <?php print colorAgressiveness('#20a68a', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-bank_account i.fa{
color: <?php print colorAgressiveness('#e39c42', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
color: <?php print colorAgressiveness('#b0a53e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-adherent i.fa{
color: <?php print colorAgressiveness('#f39c12', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;

View File

@ -742,7 +742,9 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
$head = societe_prepare_head($object->thirdparty);
dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object->thirdparty, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom');
dol_fiche_end();
}
@ -790,7 +792,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
if (!empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project');
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write)
{
if ($action != 'classify')

View File

@ -2781,6 +2781,122 @@ class Ticket extends CommonObject
setEventMessages($langs->trans('ErrorMailRecipientIsEmptyForSendTicketMessage'), null, 'warnings');
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Object user
* @param int $mode "opened" for askprice to close, "signed" for proposal to invoice
* @return int <0 if KO, >0 if OK
*/
public function load_board($user, $mode)
{
// phpcs:enable
global $conf, $user, $langs;
$now = dol_now();
$this->nbtodo = $this->nbtodolate = 0;
$clause = " WHERE";
$sql = "SELECT p.rowid, p.ref, p.datec as datec";
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as p";
if (!$user->rights->societe->client->voir && !$user->socid)
{
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".$user->id;
$clause = " AND";
}
$sql .= $clause." p.entity IN (".getEntity('ticket').")";
if ($mode == 'opened') $sql .= " AND p.fk_statut in (".Ticket::STATUS_CLOSED.", ".Ticket::STATUS_CANCELED.")";
if ($user->socid) $sql .= " AND p.fk_soc = ".$user->socid;
$resql = $this->db->query($sql);
if ($resql)
{
$label = $labelShort = '';
$status = '';
if ($mode == 'opened') {
$status = 'openall';
//$delay_warning = $conf->ticket->warning_delay;
$delay_warning = 0;
$label = $langs->trans("MenuListNonClosed");
$labelShort = $langs->trans("MenuListNonClosed");
}
$response = new WorkboardResponse();
$response->warning_delay = $delay_warning / 60 / 60 / 24;
$response->label = $label;
$response->labelShort = $labelShort;
$response->url = DOL_URL_ROOT.'/ticket/list.php?search_fk_statut[]='.$status;
$response->img = img_object('', "ticket");
// This assignment in condition is not a bug. It allows walking the results.
while ($obj = $this->db->fetch_object($resql))
{
$response->nbtodo++;
if ($mode == 'opened')
{
$datelimit = $this->db->jdate($obj->datefin);
if ($datelimit < ($now - $delay_warning))
{
//$response->nbtodolate++;
}
}
}
return $response;
}
else
{
$this->error = $this->db->lasterror();
return -1;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load indicator this->nb of global stats widget
*
* @return int <0 if ko, >0 if ok
*/
public function load_state_board()
{
// phpcs:enable
global $conf, $user;
$this->nb = array();
$clause = "WHERE";
$sql = "SELECT count(p.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$user->socid)
{
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".$user->id;
$clause = "AND";
}
$sql .= " ".$clause." p.entity IN (".getEntity('ticket').")";
$resql = $this->db->query($sql);
if ($resql)
{
// This assignment in condition is not a bug. It allows walking the results.
while ($obj = $this->db->fetch_object($resql))
{
$this->nb["ticket"] = $obj->nb;
}
$this->db->free($resql);
return 1;
}
else
{
dol_print_error($this->db);
$this->error = $this->db->lasterror();
return -1;
}
}
}

View File

@ -787,8 +787,8 @@ if (!empty($id) || !empty($ref))
print '<td class="center">'.$prodstatic->getLibStatut(2, 0).'</td>';
print '<td class="center">'.$prodstatic->getLibStatut(2, 1).'</td>';
print '<td class="right">';
print '<a class="paddingleft paddingright" href="'.dol_buildpath('/variants/combinations.php?id='.$id.'&action=edit&valueid='.$currcomb->id, 2).'">'.img_edit().'</a>';
print '<a class="paddingleft paddingright" href="'.dol_buildpath('/variants/combinations.php?id='.$id.'&action=delete&valueid='.$currcomb->id, 2).'">'.img_delete().'</a>';
print '<a class="paddingleft paddingright" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=edit&valueid='.$currcomb->id.'">'.img_edit().'</a>';
print '<a class="paddingleft paddingright" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=delete&valueid='.$currcomb->id.'">'.img_delete().'</a>';
print '</td>';
print '<td class="nowrap center">';
if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined

View File

@ -369,7 +369,11 @@ if (($action == 'replacesite' || $action == 'replacesiteconfirm') && ! $searchke
if ($massaction == 'replace')
{
$replacestring = GETPOST('replacestring', 'alphanohtml');
if (! $replacestring) {
if (empty($user->rights->website->writephp)) {
setEventMessages("NotAllowedToAddDynamicContent", null, 'errors');
}
elseif (! $replacestring) {
setEventMessages("ErrorReplaceStringEmpty", null, 'errors');
}
else {
@ -3531,12 +3535,8 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
$permissiontodelete = 0;
// List of mass actions available
$arrayofmassactions = array(
//'validate'=>$langs->trans("Validate"),
//'generate_doc'=>$langs->trans("ReGeneratePDF"),
//'builddoc'=>$langs->trans("PDFMerge"),
'replace'=>$langs->trans("Replace"),
);
$arrayofmassactions = array();
if ($user->rights->website->writephp) $arrayofmassactions['replace'] = $langs->trans("Replace");
if ($permissiontodelete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);