Debug 3.9

This commit is contained in:
Laurent Destailleur 2015-12-05 19:20:39 +01:00
parent e002021d7d
commit ff4f1e7a5b
12 changed files with 104 additions and 130 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -165,7 +165,7 @@ if ($action == 'create')
print '</td><td class="hideonsmartphone">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</td></tr>';
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
$form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:$user->id,'userid',1);
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:$user->id,'userid',1);
print '</td><td class="hideonsmartphone">&nbsp;</td></tr>';
// Position
@ -262,7 +262,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
if ($action == 'edit' && $user->admin)
{
$form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''),'userid',1);
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''),'userid',1);
}
else
{

View File

@ -176,18 +176,18 @@ class FormFile
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_id" name="link_section_id" value="'.$sectionid.'">';
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$out .= '<div>';
$out .= '<div class="float" style="padding-right: 10px;">';
$out .= '<div class="valignmiddle" >';
$out .= '<div class="inline-block" style="padding-right: 10px;">';
if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="link">'.$langs->trans("URLToLink") . ':</label> ';
$out .= '<input type="text" name="link" size="'.$maxlength.'" id="link" placeholder="'.dol_escape_htmltag($langs->trans("URLToLink")).'">';
$out .= '</div>';
$out .= '<div class="float" style="padding-right: 10px;">';
$out .= '<div class="inline-block" style="padding-right: 10px;">';
if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="label">'.$langs->trans("Label") . ':</label> ';
$out .= '<input type="text" name="label" id="label" placeholder="'.dol_escape_htmltag($langs->trans("Label")).'">';
$out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">';
$out .= '<input type="hidden" name="objectid" value="' . $object->id . '">';
$out .= '</div>';
$out .= '<div class="float" style="padding-right: 10px;">';
$out .= '<div class="inline-block" style="padding-right: 10px;">';
$out .= '<input type="submit" class="button" name="linkit" value="'.$langs->trans("ToLink").'"';
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':'');
$out .= '>';

View File

@ -658,6 +658,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
if ($num || (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x')))
{
print '<tr class="liste_titre">';
// Name - Position
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_name" size="20" value="'.$search_name.'">';
@ -766,10 +767,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '</form>'."\n";
print "<br>\n";
?>
<div id="dialog" title="<?php echo dol_escape_htmltag($langs->trans('Address')); ?>" style="display: none;"></div>
<?php
// A div for the address popup
print '<div id="dialog" title="'.dol_escape_htmltag($langs->trans('Address')).'" style="display: none;"></div>';
return $i;
}
@ -1343,7 +1342,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$i++;
}
$out.="</table>\n";
$out.="<br>\n";
//$out.="<br>\n";
}
if ($noprint) return $out;

View File

@ -37,7 +37,10 @@ if( (array) $linked_resources && count($linked_resources) > 0)
{
$var=!$var;
$object_resource = fetchObjectByElement($linked_resource['resource_id'],$linked_resource['resource_type']);
if($mode == 'edit' && $linked_resource['rowid'] == GETPOST('lineid'))
//$element_id = $linked_resource['rowid'];
if ($mode == 'edit' && $linked_resource['rowid'] == GETPOST('lineid'))
{
print '<form class="tagtr '.($var==true?'pair':'impair').'" action="'.$_SERVER["PHP_SELF"].'?element='.$element.'&element_id='.$element_id.'" method="POST">';
@ -58,7 +61,7 @@ if( (array) $linked_resources && count($linked_resources) > 0)
else
{
$style='';
if($linked_resource['rowid'] == GETPOST('lineid'))
if ($linked_resource['rowid'] == GETPOST('lineid'))
$style='style="background: orange;"';
print '<div class="tagtr '.($var==true?"pair":"impair").'" '.$style.'>';
@ -91,8 +94,6 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print '</div>';
}
}
print '</div>';

View File

@ -79,7 +79,7 @@ $fieldstosearchall = array(
* View
*/
$html = new Form($db);
$form = new Form($db);
$formother = new FormOther($db);
$expensereporttmp=new ExpenseReport($db);
@ -247,7 +247,7 @@ if ($resql)
// User
if ($user->rights->expensereport->readall || $user->rights->expensereport->lire_tous){
print '<td class="liste_titre" align="left">';
$html->select_dolusers($search_user,"search_user",1,"",0,'');
print $form->select_dolusers($search_user,"search_user",1,"",0,'');
print '</td>';
} else {
print '<td class="liste_titre">&nbsp;</td>';

View File

@ -507,13 +507,13 @@ if ($action == 'create' && $user->rights->projet->creer)
// Opportunity amount
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td>';
print '<td><input size="4" type="text" name="opp_amount" value="'.(GETPOST('opp_amount')!=''?price(GETPOST('opp_amount')):'').'"></td>';
print '<td><input size="5" type="text" name="opp_amount" value="'.(GETPOST('opp_amount')!=''?price(GETPOST('opp_amount')):'').'"></td>';
print '</tr>';
}
// Budget
print '<tr><td>'.$langs->trans("Budget").'</td>';
print '<td><input size="6" type="text" name="budget_amount" value="'.(GETPOST('budget_amount')!=''?price(GETPOST('budget_amount')):'').'"></td>';
print '<td><input size="5" type="text" name="budget_amount" value="'.(GETPOST('budget_amount')!=''?price(GETPOST('budget_amount')):'').'"></td>';
print '</tr>';
// Description
@ -672,13 +672,13 @@ else
// Opportunity amount
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td>';
print '<td><input size="6" type="text" name="opp_amount" value="'.(isset($_POST['opp_amount'])?GETPOST('opp_amount'):(strcmp($object->opp_amount,'')?price($object->opp_amount):'')).'"></td>';
print '<td><input size="5" type="text" name="opp_amount" value="'.(isset($_POST['opp_amount'])?GETPOST('opp_amount'):(strcmp($object->opp_amount,'')?price($object->opp_amount):'')).'"></td>';
print '</tr>';
}
// Budget
print '<tr><td>'.$langs->trans("Budget").'</td>';
print '<td><input size="6" type="text" name="budget_amount" value="'.(isset($_POST['budget_amount'])?GETPOST('budget_amount'):(strcmp($object->budget_amount,'')?price($object->budget_amount):'')).'"></td>';
print '<td><input size="5" type="text" name="budget_amount" value="'.(isset($_POST['budget_amount'])?GETPOST('budget_amount'):(strcmp($object->budget_amount,'')?price($object->budget_amount):'')).'"></td>';
print '</tr>';
// Description

View File

@ -49,7 +49,7 @@ $hookmanager->initHooks(array('element_resource'));
$object->available_resources = array('resource');
// Get parameters
$id = GETPOST('id','int');
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
$mode = GETPOST('mode','alpha');
$lineid = GETPOST('lineid','int');
@ -61,30 +61,40 @@ $busy = GETPOST('busy','int');
$mandatory = GETPOST('mandatory','int');
$cancel = GETPOST('cancel','alpha');
$confirm = GETPOST('confirm','alpha');
$socid = GETPOST('socid','int');
if ($socid > 0)
{
$element_id = $socid;
$element = 'societe';
}
/*
* Actions
*/
if ($action == 'add_element_resource' && ! $cancel)
{
$objstat = fetchObjectByElement($element_id, $element);
$error++;
$res = 0;
if ($resource_id > 0)
if (! ($resource_id > 0))
{
$res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory);
}
if ($res > 0)
{
setEventMessage($langs->trans('ResourceLinkedWithSuccess'),'mesgs');
header("Location: ".$_SERVER['PHP_SELF'].'?element='.$element.'&element_id='.$element_id);
exit;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Resource")), null, 'errors');
$action='';
}
else
{
setEventMessage($langs->trans('ErrorWhenLinkingResource') . " " . $objstat->error, 'errors');
header("Location: ".$_SERVER['PHP_SELF'].'?mode=add&resource_type='.$resource_type.'&element='.$element.'&element_id='.$element_id);
$objstat = fetchObjectByElement($element_id, $element);
$res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory);
}
if (! $error && $res > 0)
{
setEventMessage($langs->trans('ResourceLinkedWithSuccess'),'mesgs');
header("Location: ".$_SERVER['PHP_SELF'].'?element='.$element.'&element_id='.$element_id);
exit;
}
}
@ -103,7 +113,7 @@ if ($action == 'update_linked_resource' && $user->rights->resource->write && !GE
if ($result >= 0)
{
setEventMessage($langs->trans('RessourceLineSuccessfullyUpdated'));
Header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id);
header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id);
exit;
}
else {
@ -115,25 +125,18 @@ if ($action == 'update_linked_resource' && $user->rights->resource->write && !GE
// Delete a resource linked to an element
if ($action == 'confirm_delete_linked_resource' && $user->rights->resource->delete && $confirm === 'yes')
{
$res = $object->fetch($id);
if($res > 0)
{
$result = $object->delete_resource($lineid,$element);
$result = $object->delete_resource($lineid,$element);
if ($result >= 0)
{
setEventMessage($langs->trans('RessourceLineSuccessfullyDeleted'));
Header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id);
exit;
}
else {
setEventMessage($object->error,'errors');
}
}
else
{
setEventMessage($object->error,'errors');
}
if ($result >= 0)
{
setEventMessage($langs->trans('RessourceLineSuccessfullyDeleted'));
header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id);
exit;
}
else
{
setEventMessage($object->error,'errors');
}
}
$parameters=array('resource_id'=>$resource_id);
@ -178,12 +181,13 @@ else
/*
* Specific to agenda module
*/
if($element_id && $element == 'action')
if ($element_id && $element == 'action')
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
$act = fetchObjectByElement($element_id,$element);
if(is_object($act)) {
if (is_object($act))
{
$head=actions_prepare_head($act);
@ -219,26 +223,36 @@ else
if ($element_id && $element == 'societe')
{
$socstatic = fetchObjectByElement($element_id,$element);
if (is_object($socstatic)) {
if (is_object($socstatic))
{
$savobject = $object;
$object = $socstatic;
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$head = societe_prepare_head($socstatic);
dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"),0,'company');
// Affichage fiche action en mode visu
print '<table class="border" width="100%">';
//$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/listactions.php">'.$langs->trans("BackToList").'</a>';
// Name
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
print '<td colspan="3">';
print $form->showrefnav($socstatic, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
print '</td>';
print '</tr>';
dol_banner_tab($socstatic, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Alias name (commercial, trademark or alias name)
print '<tr><td class="titelfield">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $socstatic->name_alias;
print "</td></tr>";
print '</table>';
print '</div>';
dol_fiche_end();
$object = $savobject;
}
}
@ -248,7 +262,7 @@ else
foreach ($object->available_resources as $modresources => $resources)
foreach ($object->available_resources as $modresources => $resources)
{
$resources=(array) $resources; // To be sure $resources is an array
foreach($resources as $resource_obj)
@ -273,7 +287,7 @@ else
{
$res=include DOL_DOCUMENT_ROOT . '/core/tpl/resource_add.tpl.php';
}
//var_dump($element_id);
if ($mode != 'add' || $resource_obj != $resource_type)
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 358 B

View File

@ -64,7 +64,7 @@ $theme='eldy'; // Value of theme
if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; }
// Define image path files and other constants
$fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Helvetica, Verdana, Arial, sans-serif';
$fontlist='roboto,arial,tahoma,verdana,helvetica'; //$fontlist='helvetica, verdana, arial, sans-serif';
$img_head='';
$img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1);
$dol_hide_topmenu=$conf->dol_hide_topmenu;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 104 B

View File

@ -65,7 +65,7 @@ $theme='md'; // Value of theme
if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; }
// Define image path files and other constants
$fontlist='Open Sans,sans-serif'; //$fontlist='Verdana,Helvetica,Arial,sans-serif';
$fontlist='roboto,arial,tahoma,verdana,helvetica'; //$fontlist='verdana,helvetica,arial,sans-serif';
$img_head='';
$img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1);
$dol_hide_topmenu=$conf->dol_hide_topmenu;
@ -1704,62 +1704,8 @@ span.butAction, span.butActionDelete {
}
/*
.butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active
{
text-decoration: none;
white-space: nowrap;
padding: 0.4em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em;
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.7':'0.9'); ?>em;
font-family: <?php print $fontlist ?>;
font-weight: bold;
background: white;
border: 1px solid #8CACBB;
color: #434956;
-moz-border-radius:0px 2px 0px 2px;
-webkit-border-radius:0px 2px 0px 2px;
border-radius:0px 2px 0px 2px;
-moz-box-shadow: 2px 2px 3px #f4f4f4;
-webkit-box-shadow: 2px 2px 3px #f4f4f4;
box-shadow: 2px 2px 3px #f4f4f4;
}
.butAction:hover {
background: #dee7ec;
}
.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
border: 1px solid #997777;
}
.butActionDelete:hover {
background: #FFe7ec;
}
.butActionRefused {
text-decoration: none !important;
white-space: nowrap !important;
cursor: not-allowed;
padding: 0.4em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em;
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.7':'0.9'); ?>em;
font-family: <?php print $fontlist ?> !important;
font-weight: bold !important;
background: white !important;
border: 1px solid #AAAAAA !important;
color: #AAAAAA !important;
-moz-border-radius:0px 2px 0px 2px;
-webkit-border-radius:0px 2px 0px 2px;
border-radius:0px 2px 0px 2px;
-moz-box-shadow: 3px 3px 4px #f4f4f4;
-webkit-box-shadow: 3px 3px 4px #f4f4f4;
box-shadow: 3px 3px 4px #f4f4f4;
}
*/
/* Prepare for bootstrap look */
.butAction, .butActionDelete, .butActionRefused {
.button, .butAction, .butActionDelete, .butActionRefused {
border-color: #c5c5c5;
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
display: inline-block;
@ -1792,7 +1738,7 @@ span.butAction, span.butActionDelete {
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.butAction {
.button, .butAction {
color: #ffffff !important;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #006dcc;
@ -1807,7 +1753,21 @@ span.butAction, span.butActionDelete {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.button:disabled, .butAction:disabled {
color: #666 !important;
text-shadow: none;
border-color: #555;
cursor: not-allowed;
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);
background-repeat: repeat-x
}
.butActionDelete {
color: #ffffff !important;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
@ -1946,7 +1906,7 @@ table.liste, table.noborder, table.formdoc, div.noborder {
border-color: #BBB;
border-style: solid;
margin: 0px 0px 2px 0px;
margin: 0px 0px 8px 0px;
/*
-moz-box-shadow: 2px 2px 4px #CCC;
-webkit-box-shadow: 2px 2px 4px #CCC;
@ -3465,7 +3425,7 @@ a span.select2-chosen
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border: 1px solid #ddd;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);