Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW_comment_generic_element
This commit is contained in:
commit
e7bb7a3588
@ -366,7 +366,9 @@ if ($nboftargetok) {
|
||||
}
|
||||
else # For a maintenance release
|
||||
{
|
||||
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
|
||||
#print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
|
||||
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
|
||||
|
||||
}
|
||||
print "\n";
|
||||
if (! $ret)
|
||||
|
||||
@ -60,14 +60,14 @@ $db->begin();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
|
||||
|
||||
// Create invoice object
|
||||
// Create user object
|
||||
$obj = new User($db);
|
||||
//$obj->initAsSpecimen();
|
||||
|
||||
$obj->login = 'ABCDEF';
|
||||
$obj->nom = 'ABCDEF';
|
||||
|
||||
// Create invoice
|
||||
// Create user
|
||||
$idobject=$obj->create($user);
|
||||
if ($idobject > 0)
|
||||
{
|
||||
|
||||
@ -67,7 +67,7 @@ $db->begin();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
|
||||
|
||||
// Create invoice object
|
||||
// Create contract object
|
||||
$obj = new Contrat($db);
|
||||
$obj->socid=$argv[1];
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -37,10 +37,10 @@ $langs->load("bills");
|
||||
$langs->load("admin");
|
||||
$langs->load("accountancy");
|
||||
|
||||
// Security check
|
||||
if (empty($user->admin) && empty($user->rights->accounting->chartofaccount))
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
@ -53,13 +53,6 @@ $main_option = array (
|
||||
$model_option = array (
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV',
|
||||
'ACCOUNTING_EXPORT_DATE'
|
||||
/*
|
||||
'ACCOUNTING_EXPORT_PIECE',
|
||||
'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT',
|
||||
'ACCOUNTING_EXPORT_LABEL',
|
||||
'ACCOUNTING_EXPORT_AMOUNT',
|
||||
'ACCOUNTING_EXPORT_DEVISE'
|
||||
*/
|
||||
);
|
||||
|
||||
/*
|
||||
@ -121,17 +114,13 @@ llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
||||
|
||||
$head = admin_accounting_prepare_head();
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'export', $langs->trans("Configuration"), -1, 'cron');
|
||||
|
||||
$var = true;
|
||||
|
||||
/*
|
||||
@ -245,8 +234,6 @@ if ($num2) {
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Modify')) . '" name="button"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -37,10 +37,9 @@ $langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("admin");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("salaries");
|
||||
|
||||
// Security check
|
||||
if (empty($user->admin))
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
@ -160,18 +159,13 @@ llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
||||
|
||||
$head = admin_accounting_prepare_head($accounting);
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Configuration"), -1, 'cron');
|
||||
|
||||
|
||||
// Default mode for calculating turnover (parameter ACCOUNTING_MODE)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -287,18 +281,11 @@ foreach ($list as $key)
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<div class="opacitymedium">'.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")).'</div>';
|
||||
|
||||
print '<br>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -46,6 +46,10 @@ $mesg='';
|
||||
|
||||
$adherentstatic=new Adherent($db);
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('adherent');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -65,8 +69,12 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
$sql.= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,";
|
||||
$sql.= " t.libelle as type,";
|
||||
$sql.= " c.code as country_code, c.label as country";
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val)
|
||||
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = c.rowid";
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)";
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
|
||||
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
||||
if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid;
|
||||
@ -85,9 +93,27 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
|
||||
if ($objp->country == '-') $objp->country='';
|
||||
|
||||
$adherentstatic->id=$objp->rowid;
|
||||
$adherentstatic->lastname=$objp->lastname;
|
||||
$adherentstatic->firstname=$objp->firstname;
|
||||
|
||||
// format extrafiled so they can be parsed in function complete_substitutions_array
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
$adherentstatic->array_options = array();
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
$tmpkey='options_'.$key;
|
||||
if (!empty($objp->$tmpkey))
|
||||
{
|
||||
$adherentstatic->array_options[$tmpkey] = $objp->$tmpkey;
|
||||
}
|
||||
//if (!empty($objp->$key))
|
||||
// $objp->array_options[$tmpkey] = $objp->$key;
|
||||
//$objp->array_options[$tmpkey] = $extrafields->showOutputField($key, $objp->$tmpkey, '', 1); //$objp->$tmpkey;
|
||||
}
|
||||
}
|
||||
|
||||
// List of values to scan for a replacement
|
||||
$substitutionarray = array (
|
||||
'%ID%'=>$objp->rowid,
|
||||
@ -110,7 +136,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/"
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
complete_substitutions_array($substitutionarray, $langs, $adherentstatic);
|
||||
|
||||
// For business cards
|
||||
if (empty($mode) || $mode=='card' || $mode=='cardlogin')
|
||||
|
||||
@ -211,11 +211,11 @@ class Dolistore
|
||||
|
||||
// add image or default ?
|
||||
if ($product->id_default_image != '') {
|
||||
$image_url = DOL_URL_ROOT.'/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
|
||||
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
|
||||
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang].', '.$langs->trans('Version').' '.$product->module_version.'">'.
|
||||
'<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
|
||||
} else {
|
||||
$images = '<img src="'.DOL_URL_ROOT.'/dolistore/img/NoImageAvailable.png" />';
|
||||
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
|
||||
}
|
||||
|
||||
// free or pay ?
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
<html><head><title>CRUD Tutorial - Customer's list</title></head><body>
|
||||
<?php
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
* PrestaShop Webservice Library
|
||||
* @package PrestaShopWebservice
|
||||
*/
|
||||
// Here we define constants /!\ You need to replace this parameters
|
||||
//https://dolistorecatalogpublickey1234567@vmdevwww.dolistore.com/api/
|
||||
define('DEBUG', true); // Debug mode
|
||||
define('PS_SHOP_PATH', 'https://www.dolistore.com/'); // Root path of your PrestaShop store
|
||||
define('PS_WS_AUTH_KEY', 'dolistorecatalogpublickey1234567'); // Auth key (Get it in your Back Office)
|
||||
require_once('./PSWebServiceLibrary.php');
|
||||
// Here we make the WebService Call
|
||||
try
|
||||
{
|
||||
$webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG);
|
||||
|
||||
// Here we set the option array for the Webservice : we want customers resources
|
||||
$opt['resource'] = 'categories';
|
||||
$opt['id'] = '1';
|
||||
|
||||
// Call
|
||||
$xml = $webService->get($opt);
|
||||
// Here we get the elements from children of customers markup "customer"
|
||||
$resources = $xml->categories->children();
|
||||
}
|
||||
catch (PrestaShopWebserviceException $e)
|
||||
{
|
||||
// Here we are dealing with errors
|
||||
$trace = $e->getTrace();
|
||||
if ($trace[0]['args'][0] == 404) echo 'Bad ID';
|
||||
else if ($trace[0]['args'][0] == 401) echo 'Bad auth key';
|
||||
else echo 'Other error';
|
||||
}
|
||||
// We set the Title
|
||||
echo "<h1>Categories's List</h1>";
|
||||
echo '<table border="5">';
|
||||
// if $resources is set we can lists element in it otherwise do nothing cause there's an error
|
||||
if (isset($resources))
|
||||
{
|
||||
echo '<tr><th>Id</th></tr>';
|
||||
foreach ($resources as $resource)
|
||||
{
|
||||
// Iterates on the found IDs
|
||||
echo '<tr><td>'.$resource->attributes().'</td></tr>';
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
?>
|
||||
</body></html>
|
||||
@ -254,7 +254,7 @@ if ($action == 'reset' && $user->admin)
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$morejs = array("/admin/dolistore/js/dolistore.js.php");
|
||||
//$morejs = array("/admin/dolistore/js/dolistore.js.php");
|
||||
$morecss = array("/admin/dolistore/css/dolistore.css");
|
||||
|
||||
// Set dir where external modules are installed
|
||||
|
||||
@ -5041,7 +5041,7 @@ class Form
|
||||
}
|
||||
elseif ($typehour=='text' || $typehour=='textselect')
|
||||
{
|
||||
$retstring.='<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" size="1" name="'.$prefix.'hour"'.($disabled?' disabled':'').' class="flat maxwidth50" value="'.(($hourSelected != '')?((int) $hourSelected):'').'">';
|
||||
$retstring.='<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" size="1" name="'.$prefix.'hour"'.($disabled?' disabled':'').' class="flat maxwidth50 inputhour" value="'.(($hourSelected != '')?((int) $hourSelected):'').'">';
|
||||
}
|
||||
else return 'BadValueForParameterTypeHour';
|
||||
|
||||
@ -5065,7 +5065,7 @@ class Form
|
||||
}
|
||||
elseif ($typehour=='text' )
|
||||
{
|
||||
$retstring.='<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" size="1" name="'.$prefix.'min"'.($disabled?' disabled':'').' class="flat maxwidth50" value="'.(($minSelected != '')?((int) $minSelected):'').'">';
|
||||
$retstring.='<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" size="1" name="'.$prefix.'min"'.($disabled?' disabled':'').' class="flat maxwidth50 inputminute" value="'.(($minSelected != '')?((int) $minSelected):'').'">';
|
||||
}
|
||||
|
||||
if ($typehour!='text') $retstring.=' '.$langs->trans('MinuteShort');
|
||||
|
||||
@ -163,6 +163,56 @@ function updateTotal(days,mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add data on the perday view
|
||||
jQuery('.inputhour').each(function( index ) {
|
||||
if (this.value)
|
||||
{
|
||||
var taskTime= new Date(0);
|
||||
/*console.log(total.getHours())
|
||||
console.log(this.value)
|
||||
alert(element.value);*/
|
||||
if (this.value)
|
||||
{
|
||||
console.log(this.value+':00')
|
||||
result=parseTime(this.value+':00',taskTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
result=parseTime(this.innerHTML+':00',taskTime);
|
||||
}
|
||||
if (result >= 0)
|
||||
{
|
||||
total.setHours(total.getHours()+taskTime.getHours());
|
||||
}
|
||||
console.log(total.getHours())
|
||||
}
|
||||
});
|
||||
// Add data on the perday view
|
||||
jQuery('.inputminute').each(function( index ) {
|
||||
if (this.value)
|
||||
{
|
||||
var taskTime= new Date(0);
|
||||
/* console.log(total.getHours())
|
||||
console.log(this.value)
|
||||
alert(element.value);*/
|
||||
if (this.value)
|
||||
{
|
||||
console.log('00:'+this.value)
|
||||
result=parseTime('00:'+"00".substring(0, 2 - this.value.length) + this.value,taskTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
result=parseTime('00:'+"00".substring(0, 2 - this.innerHTML) + this.innerHTML,taskTime);
|
||||
}
|
||||
if (result >= 0)
|
||||
{
|
||||
total.setMinutes(total.getMinutes()+taskTime.getMinutes());
|
||||
}
|
||||
console.log(total.getMinutes())
|
||||
}
|
||||
});
|
||||
|
||||
if (document.getElementById('totalDay['+days+']')) // May be null if no task records to output (nbline is also 0 in this case)
|
||||
{
|
||||
document.getElementById('totalDay['+days+']').innerHTML = pad(total.getHours())+':'+pad(total.getMinutes());
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -23,40 +23,6 @@
|
||||
* \brief Library of accountancy functions
|
||||
*/
|
||||
|
||||
/**
|
||||
* Prepare array with list of admin tabs
|
||||
*
|
||||
* @param AccountingAccount $object Object instance we show card
|
||||
* @return array Array of tabs to show
|
||||
*/
|
||||
function admin_accounting_prepare_head(AccountingAccount $object=null)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
$head = array ();
|
||||
|
||||
$head[$h][0] = dol_buildpath('/accountancy/admin/index.php', 1);
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'general';
|
||||
$h ++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/export.php';
|
||||
$head[$h][1] = $langs->trans("ExportOptions");
|
||||
$head[$h][2] = 'export';
|
||||
$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
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
|
||||
@ -187,7 +187,7 @@ function task_prepare_head($object)
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
|
||||
|
||||
|
||||
// Manage discussion
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK))
|
||||
{
|
||||
@ -210,7 +210,7 @@ function task_prepare_head($object)
|
||||
$head[$h][2] = 'task_notes';
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
|
||||
$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -751,6 +751,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
$alreadyspent='';
|
||||
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($dayWorkLoad,'allhourmin');
|
||||
|
||||
$idw = 0;
|
||||
|
||||
$tableCell='';
|
||||
$tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center" size="2" disabled id="timespent['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="'.$alreadyspent.'"></span>';
|
||||
$tableCell.=' + ';
|
||||
@ -758,6 +760,15 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
$tableCell.=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
|
||||
//$tableCell.=' <input type="submit" class="button"'.($disabledtask?' disabled':'').' value="'.$langs->trans("Add").'">';
|
||||
print $tableCell;
|
||||
|
||||
$modeinput='hours';
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
print "jQuery(document).ready(function () {\n";
|
||||
print " jQuery('.inputhour, .inputminute').bind('keyup', function(e) { updateTotal(0, '".$modeinput."') });";
|
||||
print "})\n";
|
||||
print '</script>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
@ -983,8 +994,9 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
}
|
||||
$tableCell.='<input type="text" alt="'.($disabledtask?'':$alttitle).'" title="'.($disabledtask?'':$alttitle).'" '.($disabledtask?'disabled':$placeholder).' class="center smallpadd" size="2" id="timeadded['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="" cols="2" maxlength="5"';
|
||||
$tableCell.=' onkeypress="return regexEvent(this,event,\'timeChar\')"';
|
||||
$tableCell.= 'onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$idw.',\''.$modeinput.'\')" />';
|
||||
$tableCell.='</td>';
|
||||
$tableCell.=' onkeyup="updateTotal('.$idw.',\''.$modeinput.'\')"';
|
||||
$tableCell.=' onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$idw.',\''.$modeinput.'\')" />';
|
||||
$tableCell.='</td>';
|
||||
print $tableCell;
|
||||
}
|
||||
|
||||
|
||||
@ -217,18 +217,21 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
-- Setup
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 1, __ENTITY__);
|
||||
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2454__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_journal', 2451__+MAX_llx_menu__, '/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingJournals', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 10, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2455__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartmodel', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Pcg_version', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2453__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_general', 2451__+MAX_llx_menu__, '/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'General', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 10, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2454__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_journal', 2451__+MAX_llx_menu__, '/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingJournals', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2455__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartmodel', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Pcg_version', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 41, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__);
|
||||
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 52, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 51, __ENTITY__);
|
||||
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 80, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 90, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 52, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 53, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 54, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 55, __ENTITY__);
|
||||
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__);
|
||||
-- Accounting period
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__);
|
||||
-- Binding
|
||||
|
||||
@ -969,37 +969,30 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
|
||||
// Chart of account
|
||||
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 10);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 20);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 30);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 31);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 40);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 42);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
|
||||
}
|
||||
if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52);
|
||||
}
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53);
|
||||
}
|
||||
if (! empty($conf->expensereport->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54);
|
||||
}
|
||||
/* not required yet, already supported by default account
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/loan.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuLoanAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_loan', 45);
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/don/admin/donation.php?from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDonationAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_donation', 47);
|
||||
}*/
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 60);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60);
|
||||
|
||||
// Fiscal year
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // Not yet used. In a future will lock some periods.
|
||||
@ -1083,36 +1076,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$db->free($resql);
|
||||
|
||||
/*
|
||||
$sql = "SELECT rowid, label, accountancy_journal";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
$sql.= " ORDER BY label";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0)
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_account='.$objp->rowid,$langs->trans("Journal").' - '.dol_trunc($objp->label,10),2,$user->rights->accounting->comptarapport->lire);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$db->free($resql);
|
||||
|
||||
// Add other journal
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("SellsJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("PurchasesJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("ExpenseReportsJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
*/
|
||||
}
|
||||
|
||||
// General Ledger
|
||||
@ -1419,6 +1382,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("ListToApprove"), 2, $user->rights->expensereport->approve);
|
||||
$newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire);
|
||||
}
|
||||
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
$langs->load("projects");
|
||||
|
||||
$search_project_user = GETPOST('search_project_user','int');
|
||||
|
||||
$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user?'&search_project_user='.$search_project_user:''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -35,12 +35,12 @@ class modAccounting extends DolibarrModules
|
||||
* Constructor. Define names, constants, directories, boxes, permissions
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
$this->db = $db;
|
||||
$this->numero = 50400;
|
||||
|
||||
$this->family = "financial";
|
||||
@ -60,7 +60,7 @@ class modAccounting extends DolibarrModules
|
||||
$this->dirs = array('/accounting/temp');
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array('index.php@accountancy');
|
||||
$this->config_page_url = array();
|
||||
|
||||
// Dependencies
|
||||
$this->depends = array("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled
|
||||
@ -84,116 +84,57 @@ class modAccounting extends DolibarrModules
|
||||
"1",
|
||||
"With this constants on, bank account number is always required"
|
||||
);
|
||||
$this->const[1] = array(
|
||||
"ACCOUNTING_EXPORT_SEPARATORCSV",
|
||||
"string",
|
||||
","
|
||||
);
|
||||
$this->const[2] = array(
|
||||
$this->const[3] = array(
|
||||
"ACCOUNTING_ACCOUNT_SUSPENSE",
|
||||
"chaine",
|
||||
"471"
|
||||
);
|
||||
$this->const[3] = array(
|
||||
"ACCOUNTING_SELL_JOURNAL",
|
||||
"chaine",
|
||||
"VTE"
|
||||
);
|
||||
$this->const[4] = array(
|
||||
"ACCOUNTING_PURCHASE_JOURNAL",
|
||||
"chaine",
|
||||
"ACH"
|
||||
);
|
||||
$this->const[5] = array(
|
||||
"ACCOUNTING_SOCIAL_JOURNAL",
|
||||
"chaine",
|
||||
"SOC"
|
||||
);
|
||||
$this->const[6] = array(
|
||||
"ACCOUNTING_MISCELLANEOUS_JOURNAL",
|
||||
"chaine",
|
||||
"OD"
|
||||
);
|
||||
$this->const[7] = array(
|
||||
"ACCOUNTING_ACCOUNT_TRANSFER_CASH",
|
||||
"chaine",
|
||||
"58"
|
||||
);
|
||||
$this->const[8] = array(
|
||||
$this->const[5] = array(
|
||||
"CHARTOFACCOUNTS",
|
||||
"chaine",
|
||||
"2"
|
||||
);
|
||||
$this->const[9] = array(
|
||||
$this->const[6] = array(
|
||||
"ACCOUNTING_EXPORT_MODELCSV",
|
||||
"chaine",
|
||||
"1"
|
||||
);
|
||||
$this->const[10] = array(
|
||||
$this->const[7] = array(
|
||||
"ACCOUNTING_LENGTH_GACCOUNT",
|
||||
"chaine",
|
||||
""
|
||||
);
|
||||
$this->const[11] = array(
|
||||
$this->const[8] = array(
|
||||
"ACCOUNTING_LENGTH_AACCOUNT",
|
||||
"chaine",
|
||||
""
|
||||
);
|
||||
$this->const[13] = array(
|
||||
$this->const[9] = array(
|
||||
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
|
||||
"yesno",
|
||||
"1"
|
||||
);
|
||||
$this->const[14] = array(
|
||||
$this->const[10] = array(
|
||||
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
|
||||
"yesno",
|
||||
"1"
|
||||
);
|
||||
/*
|
||||
$this->const[15] = array (
|
||||
"ACCOUNTING_GROUPBYACCOUNT",
|
||||
"yesno",
|
||||
"1"
|
||||
);
|
||||
*/
|
||||
$this->const[16] = array (
|
||||
$this->const[11] = array (
|
||||
"ACCOUNTING_EXPORT_DATE",
|
||||
"chaine",
|
||||
"%d%m%Y"
|
||||
);
|
||||
/*
|
||||
$this->const[17] = array (
|
||||
"ACCOUNTING_EXPORT_PIECE",
|
||||
"yesno",
|
||||
"1"
|
||||
$this->const[12] = array(
|
||||
"ACCOUNTING_EXPORT_SEPARATORCSV",
|
||||
"string",
|
||||
","
|
||||
);
|
||||
$this->const[18] = array (
|
||||
"ACCOUNTING_EXPORT_GLOBAL_ACCOUNT",
|
||||
"yesno",
|
||||
"1"
|
||||
);
|
||||
$this->const[19] = array (
|
||||
"ACCOUNTING_EXPORT_LABEL",
|
||||
"yesno",
|
||||
"1"
|
||||
);
|
||||
$this->const[20] = array (
|
||||
"ACCOUNTING_EXPORT_AMOUNT",
|
||||
"yesno",
|
||||
"1"
|
||||
);
|
||||
$this->const[21] = array (
|
||||
"ACCOUNTING_EXPORT_DEVISE",
|
||||
"yesno",
|
||||
"1"
|
||||
);
|
||||
*/
|
||||
$this->const[22] = array(
|
||||
"ACCOUNTING_EXPENSEREPORT_JOURNAL",
|
||||
"chaine",
|
||||
"ER"
|
||||
);
|
||||
$this->const[23] = array(
|
||||
$this->const[13] = array(
|
||||
"ACCOUNTING_EXPORT_FORMAT",
|
||||
"chaine",
|
||||
"csv"
|
||||
|
||||
@ -765,6 +765,10 @@ if (! empty($id) && $action != 'edit')
|
||||
|
||||
print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('don'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
74
htdocs/don/tpl/linkedobjectblock.tpl.php
Normal file
74
htdocs/don/tpl/linkedobjectblock.tpl.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Charlene Benke <cf.benke@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
|
||||
<?php
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
$langs = $GLOBALS['langs'];
|
||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
|
||||
$langs->load("donations");
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>">
|
||||
<td><?php echo $langs->trans("Donation"); ?></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td align="center"><?php echo $objectlink->ref_client; ?></td>
|
||||
<td align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td align="right"><?php
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?>
|
||||
</td>
|
||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
?>
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td align="right"><?php echo price($total); ?></td>
|
||||
<td align="right"></td>
|
||||
<td align="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
@ -286,6 +286,19 @@ CREATE TABLE IF NOT EXISTS llx_comment (
|
||||
import_key varchar(125) DEFAULT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
-- Accountancy - Remove old constants
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_SELL_JOURNAL')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_PURCHASE_JOURNAL')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_SOCIAL_JOURNAL')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_MISCELLANEOUS_JOURNAL')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_GROUPBYACCOUNT')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPORT_GLOBAL_ACCOUNT')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPORT_LABEL')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPORT_AMOUNT')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPORT_DEVISE')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPORT_PIECE')__;
|
||||
DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPENSEREPORT_JOURNAL')__;
|
||||
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8;
|
||||
|
||||
@ -332,8 +332,7 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($proj
|
||||
//var_dump($projectsrole);
|
||||
//var_dump($taskrole);
|
||||
|
||||
|
||||
llxHeader("",$title,"");
|
||||
llxHeader("",$title,"",'','','',array('/core/js/timesheet.js'));
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
||||
|
||||
@ -489,6 +488,16 @@ if (count($tasksarray) > 0)
|
||||
{
|
||||
$j=0;
|
||||
projectLinesPerDay($j, 0, $usertoprocess, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $daytoparse);
|
||||
|
||||
$colspan = 8;
|
||||
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) $colspan++;
|
||||
|
||||
print '<tr class="liste_total">
|
||||
<td class="liste_total" colspan="'.$colspan.'">'.$langs->trans("Total").'</td>
|
||||
<td class="liste_total hide0" align="center"><div id="totalDay[0]"> </div></td>
|
||||
<td class="liste_total"></td>
|
||||
<td class="liste_total"></td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -497,16 +506,20 @@ else
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print '<input type="hidden" id="numberOfLines" name="numberOfLines" value="'.count($tasksarray).'"/>'."\n";
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button"'.($disabledtask?' disabled':'').' value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
$modeinput='hours';
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
print "jQuery(document).ready(function () {\n";
|
||||
print ' jQuery(".timesheetalreadyrecorded").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50, content: \''.dol_escape_js($langs->trans("TimeAlreadyRecorded", $user->getFullName($langs))).'\'});';
|
||||
print ' jQuery(".timesheetalreadyrecorded").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50, content: \''.dol_escape_js($langs->trans("TimeAlreadyRecorded", $user->getFullName($langs))).'\'});';
|
||||
print ' updateTotal(0,\''.$modeinput.'\');';
|
||||
print "});";
|
||||
print '</script>';
|
||||
|
||||
|
||||
@ -515,7 +515,6 @@ else
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print '<input type="hidden" name="timestamp" value="1425423513"/>'."\n";
|
||||
print '<input type="hidden" id="numberOfLines" name="numberOfLines" value="'.count($tasksarray).'"/>'."\n";
|
||||
|
||||
print '<div class="center">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user