Merge remote-tracking branch 'Upstream/develop' into 4.0-p9

Conflicts:
	htdocs/accountancy/admin/card.php
This commit is contained in:
aspangaro 2016-03-30 06:05:38 +02:00
commit 26e017f4ef
12 changed files with 74 additions and 39 deletions

View File

@ -18,9 +18,9 @@
*/
/**
* \file htdocs/accountancy/admin/card.php
* \ingroup Accounting Expert
* \brief Card accounting account
* \file htdocs/accountancy/admin/card.php
* \ingroup Advanced accountancy
* \brief Card of accounting account
*/
require '../../main.inc.php';
@ -56,11 +56,14 @@ if ($action == 'add') {
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
$result = $db->query($sql);
$obj = $db->fetch_object($result);
// Clean code
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
$object->fk_pcg_version = $obj->pcg_version;
$object->pcg_type = GETPOST('pcg_type');
$object->pcg_subtype = GETPOST('pcg_subtype');
$object->account_number = GETPOST('account_number');
$object->account_number = $account_number';
$object->account_parent = GETPOST('account_parent', 'int');
$object->account_category = GETPOST('account_category');
$object->label = GETPOST('label', 'alpha');
@ -90,11 +93,14 @@ if ($action == 'add') {
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
$result2 = $db->query($sql);
$obj = $db->fetch_object($result2);
// Clean code
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
$object->fk_pcg_version = $obj->pcg_version;
$object->pcg_type = GETPOST('pcg_type');
$object->pcg_subtype = GETPOST('pcg_subtype');
$object->account_number = GETPOST('account_number');
$object->account_number = $account_number;
$object->account_parent = GETPOST('account_parent', 'int');
$object->account_category = GETPOST('account_category');
$object->label = GETPOST('label', 'alpha');

View File

@ -40,8 +40,8 @@ if (GETPOST('msg','alpha')) {
$urldolibarr='http://www.dolibarr.org/downloads/';
$urldolibarrmodules='http://www.dolistore.com/';
$urldolibarrthemes='http://www.dolistore.com/';
$urldolibarrmodules='https://www.dolistore.com/';
$urldolibarrthemes='https://www.dolistore.com/';
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
$dolibarrroot=preg_replace('/([^\\/]+)$/i','',$dolibarrroot);
$dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT);

View File

@ -656,7 +656,7 @@ if ($action == 'create')
}
// Title
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" size="60" value="'.GETPOST('label').'"></td></tr>';
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
// Full day
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked':'').'></td></tr>';

View File

@ -797,7 +797,7 @@ else
{
print '<tr><td><label for="socid">'.$langs->trans("ThirdParty").'</label></td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1),'socid','',1);
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1), 'socid', '', $langs->trans("SelectThirdParty"));
print '</td>';
print '</tr>';
}

View File

@ -59,7 +59,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact
$object->old_name='';
$object->old_firstname='';
// Logo/Photo save
$dir= $conf->societe->dir_output.'/contact/' . get_exdir($object->id,2,0,1,$object,'contact').'/photos';
$dir= $conf->societe->dir_output.'/contact/' . get_exdir($object->id,0,0,1,$object,'contact').'/photos';
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
if ($file_OK)
@ -68,8 +68,8 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact
if (GETPOST('deletephoto'))
{
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileimg=$conf->societe->dir_output.'/contact/'.get_exdir($object->id,2,0,1,$object,'contact').'/photos/'.$object->photo;
$dirthumbs=$conf->societe->dir_output.'/contact/'.get_exdir($object->id,2,0,1,$object,'contact').'/photos/thumbs';
$fileimg=$conf->societe->dir_output.'/contact/'.get_exdir($object->id,0,0,1,$object,'contact').'/photos/'.$object->photo;
$dirthumbs=$conf->societe->dir_output.'/contact/'.get_exdir($object->id,0,0,1,$object,'contact').'/photos/thumbs';
dol_delete_file($fileimg);
dol_delete_dir_recursive($dirthumbs);
}

View File

@ -5501,8 +5501,8 @@ class Form
//$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):'&nbsp;').'</a>':'';
//$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):'&nbsp;').'</a>':'';
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'&lt;':'&nbsp;').'</a>':'';
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'&gt;':'&nbsp;').'</a>':'';
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'&lt;':'&nbsp;').'</a>':'<span class="inactive">'.(empty($conf->dol_use_jmobile)?'&lt;':'&nbsp;').'</span>';
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'&gt;':'&nbsp;').'</a>':'<span class="inactive">'.(empty($conf->dol_use_jmobile)?'&gt;':'&nbsp;').'</span>';
//print "xx".$previous_ref."x".$next_ref;
$ret.='<div style="vertical-align: middle">';

View File

@ -93,11 +93,17 @@ function project_prepare_head($object)
// Then tab for sub level of projet, i mean tasks
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id;
$head[$h][1] = $langs->trans("Tasks");
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
$taskstatic=new Task($db);
$nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0));
if ($nbTasks > 0) $head[$h][1].= ' <span class="badge">'.($nbTasks).'</span>';
$head[$h][2] = 'tasks';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id;
$head[$h][1] = $langs->trans("Gantt");
if ($nbTasks > 0) $head[$h][1].= ' <span class="badge">'.($nbTasks).'</span>';
$head[$h][2] = 'gantt';
$h++;
}
@ -116,7 +122,7 @@ function project_prepare_head($object)
*/
function task_prepare_head($object)
{
global $langs, $conf, $user;
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
@ -156,8 +162,10 @@ function task_prepare_head($object)
$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';
$listoffiles=dol_dir_list($filesdir,'files',1,'','thumbs');
$head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));
$nbFiles = count(dol_dir_list($filesdir,'files',0,'','(\.meta|_preview\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][1] = $langs->trans('Documents');
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
$head[$h][2] = 'task_document';
$h++;

View File

@ -299,25 +299,28 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
/*
* Actions
*/
print '<div class="tabsAction">';
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
if (empty($id))
{
if ($object->public || $userWrite > 0)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans('AddTask').'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTask').'</a>';
}
print '<div class="tabsAction">';
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
{
if ($object->public || $userWrite > 0)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans('AddTask').'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTask').'</a>';
}
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTask').'</a>';
}
print '</div>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTask').'</a>';
}
print '</div>';
}
}

View File

@ -438,6 +438,9 @@ th .button {
.quatrevingtpercent, .inputsearch {
width: 80%;
}
.soixantepercent {
width: 60%;
}
textarea.centpercent {
width: 96%;
}
@ -2292,6 +2295,16 @@ div.pagination li.pagination span {
}
div.pagination li.pagination span.inactive {
cursor: default;
color: #ccc;
}
div.pagination li a.inactive:hover,
div.pagination li span.inactive:hover {
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
}
/*div.pagination li.litext {
padding-top: 8px;
@ -3822,7 +3835,7 @@ dl.dropdown {
position:absolute;
top:2px;
list-style:none;
max-height: 200px;
max-height: 300px;
overflow: auto;
}
.dropdown span.value {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 214 B

View File

@ -425,6 +425,9 @@ th .button {
.quatrevingtpercent, .inputsearch {
width: 80%;
}
.soixantepercent {
width: 60%;
}
textarea.centpercent {
width: 96%;
}
@ -2134,7 +2137,9 @@ div.pagination li.pagination span {
}
div.pagination li.pagination span.inactive {
cursor: default;
color: #ccc;
}
div.pagination li.litext a {
border: none;
padding-right: 10px;
@ -3611,7 +3616,7 @@ span.noborderoncategories a, li.noborderoncategories a {
line-height: normal;
}
span.noborderoncategories {
padding: 5px 5px 0px 5px;
padding: 3px 5px 0px 5px;
}
.categtextwhite, .treeview .categtextwhite.hover {
color: #fff !important;
@ -3662,7 +3667,7 @@ dl.dropdown {
position:absolute;
top:2px;
list-style:none;
max-height: 200px;
max-height: 300px;
overflow: auto;
}
.dropdown span.value {

View File

@ -162,7 +162,7 @@ class User extends CommonObject
*/
function fetch($id='', $login='',$sid='',$loadpersonalconf=1, $entity=-1)
{
global $langs, $conf, $user;
global $conf, $user;
// Clean parameters
$login=trim($login);
@ -256,7 +256,7 @@ class User extends CommonObject
$this->country_id = $obj->country_id;
$this->country_code = $obj->country_id?$obj->country_code:'';
$this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):'';
//$this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):'';
$this->state_id = $obj->state_id;
$this->state_code = $obj->state_code;