Debug v17
This commit is contained in:
parent
67bf4a3ec0
commit
36cf05318b
@ -39,6 +39,9 @@ class FormProjets
|
||||
*/
|
||||
public $error = '';
|
||||
|
||||
public $errors = array();
|
||||
|
||||
|
||||
public $nboftasks;
|
||||
|
||||
|
||||
@ -622,6 +625,8 @@ class FormProjets
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
$sellist = '';
|
||||
|
||||
if ($num > 0) {
|
||||
$sellist = '<select class="flat elementselect css'.$table_element.($morecss ? ' '.$morecss : '').'" name="elementselect">';
|
||||
$sellist .= '<option value="-1"'.($placeholder ? ' class="optiongrey"' : '').'>'.$placeholder.'</option>';
|
||||
|
||||
@ -1423,13 +1423,17 @@ function dol_string_nounprintableascii($str, $removetabcrlf = 1)
|
||||
/**
|
||||
* Returns text escaped for inclusion into javascript code
|
||||
*
|
||||
* @param string $stringtoescape String to escape
|
||||
* @param int $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
|
||||
* @param int $noescapebackslashn 0=Escape also \n. 1=Do not escape \n.
|
||||
* @return string Escaped string. Both ' and " are escaped into ' if they are escaped.
|
||||
* @param string $stringtoescape String to escape
|
||||
* @param int $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
|
||||
* @param int $noescapebackslashn 0=Escape also \n. 1=Do not escape \n.
|
||||
* @return string Escaped string. Both ' and " are escaped into ' if they are escaped.
|
||||
*/
|
||||
function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0)
|
||||
{
|
||||
if (is_null($stringtoescape)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// escape quotes and backslashes, newlines, etc.
|
||||
$substitjs = array("'"=>"\\'", "\r"=>'\\r');
|
||||
//$substitjs['</']='<\/'; // We removed this. Should be useless.
|
||||
@ -11891,8 +11895,8 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
||||
|
||||
'contact_id'=>$obj->fk_contact,
|
||||
'socpeopleassigned' => $contactaction->socpeopleassigned,
|
||||
'lastname'=>$obj->lastname,
|
||||
'firstname'=>$obj->firstname,
|
||||
'lastname' => (empty($obj->lastname) ? '' : $obj->lastname),
|
||||
'firstname' => (empty($obj->firstname) ? '' : $obj->firstname),
|
||||
'fk_element'=>$obj->fk_element,
|
||||
'elementtype'=>$obj->elementtype,
|
||||
// Type of event
|
||||
|
||||
@ -344,7 +344,9 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '',
|
||||
} else {
|
||||
$objectid = $object; // $objectid can be X or 'X,Y,Z'
|
||||
}
|
||||
$objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input
|
||||
if ($objectid) {
|
||||
$objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input
|
||||
}
|
||||
|
||||
//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
|
||||
//print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid;
|
||||
|
||||
@ -156,7 +156,7 @@ class modTicket extends DolibarrModules
|
||||
'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
|
||||
'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
|
||||
'tabrowid' => array("rowid", "rowid", "rowid", "rowid"),
|
||||
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && !empty($conf->global->TICKET_ENABLE_RESOLUTION)),
|
||||
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && getDolGlobalString('TICKET_ENABLE_RESOLUTION')),
|
||||
'tabhelp' => array(
|
||||
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
|
||||
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
|
||||
|
||||
@ -1299,7 +1299,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($object->budget_amount, '')) {
|
||||
if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
|
||||
print '<span class="amount">'.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -1443,9 +1443,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
</script>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions Buttons
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
|
||||
@ -136,7 +136,7 @@ print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($object->budget_amount, '')) {
|
||||
if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
|
||||
print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -387,7 +387,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($object->budget_amount, '')) {
|
||||
if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
|
||||
print '<span class="amount">'.price($object->budget_amount, '', $langs, 0, 0, 0, $conf->currency).'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -291,14 +291,14 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
|
||||
// Opportunity percent
|
||||
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td><td>';
|
||||
if (strcmp($object->opp_percent, '')) {
|
||||
if (!is_null($object->opp_percent) && strcmp($object->opp_percent, '')) {
|
||||
print price($object->opp_percent, '', $langs, 1, 0).' %';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Opportunity Amount
|
||||
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
|
||||
if (strcmp($object->opp_amount, '')) {
|
||||
if (!is_null($object->opp_amount) && strcmp($object->opp_amount, '')) {
|
||||
print '<span class="amount">'.price($object->opp_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>';
|
||||
if (strcmp($object->opp_percent, '')) {
|
||||
print ' <span title="'.dol_escape_htmltag($langs->trans('OpportunityWeightedAmount')).'"><span class="opacitymedium">'.$langs->trans("Weighted").'</span>: <span class="amount">'.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).'</span></span>';
|
||||
@ -309,7 +309,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($object->budget_amount, '')) {
|
||||
if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
|
||||
print '<span class="amount">'.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -657,7 +657,6 @@ if (!empty($conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN)) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
$parameters = array('listofreferent'=>$listofreferent);
|
||||
$resHook = $hookmanager->executeHooks('completeListOfReferent', $parameters, $object, $action);
|
||||
|
||||
@ -693,7 +692,7 @@ if (!$showdatefilter) {
|
||||
print '<div class="center centpercent">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||
print '<input type="hidden" name="tablename" value="'.(empty($tablename) ? '' : $tablename).'">';
|
||||
print '<input type="hidden" name="action" value="view">';
|
||||
print '<div class="inline-block">';
|
||||
print $form->selectDate($dates, 'dates', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
@ -730,7 +729,7 @@ $tooltiponprofitplus = $tooltiponprofitminus = '';
|
||||
foreach ($listofreferent as $key => $value) {
|
||||
$name = $langs->trans($value['name']);
|
||||
$qualified = $value['test'];
|
||||
$margin = $value['margin'];
|
||||
$margin = empty($value['margin']) ? 0 : $value['margin'];
|
||||
if ($qualified && isset($margin)) { // If this element must be included into profit calculation ($margin is 'minus' or 'add')
|
||||
if ($margin == 'add') {
|
||||
$tooltiponprofitplus .= ' > '.$name." (+)<br>\n";
|
||||
@ -777,8 +776,8 @@ foreach ($listofreferent as $key => $value) {
|
||||
$tablename = $value['table'];
|
||||
$datefieldname = $value['datefieldname'];
|
||||
$qualified = $value['test'];
|
||||
$margin = $value['margin'];
|
||||
$project_field = $value['project_field'];
|
||||
$margin = empty($value['margin']) ? 0 : $value['margin'];
|
||||
$project_field = empty($value['project_field']) ? '' : $value['project_field'];
|
||||
if ($qualified && isset($margin)) { // If this element must be included into profit calculation ($margin is 'minus' or 'add')
|
||||
$element = new $classname($db);
|
||||
|
||||
@ -990,11 +989,11 @@ foreach ($listofreferent as $key => $value) {
|
||||
$tablename = $value['table'];
|
||||
$datefieldname = $value['datefieldname'];
|
||||
$qualified = $value['test'];
|
||||
$langtoload = $value['lang'];
|
||||
$urlnew = $value['urlnew'];
|
||||
$buttonnew = $value['buttonnew'];
|
||||
$testnew = $value['testnew'];
|
||||
$project_field = $value['project_field'];
|
||||
$langtoload = empty($value['lang']) ? '' : $value['lang'];
|
||||
$urlnew = empty($value['urlnew']) ? '' : $value['urlnew'];
|
||||
$buttonnew = empty($value['buttonnew']) ? '' : $value['buttonnew'];
|
||||
$testnew = empty($value['testnew']) ? '' : $value['testnew'];
|
||||
$project_field = empty($value['project_field']) ? '' : $value['project_field'];
|
||||
|
||||
$exclude_select_element = array('payment_various');
|
||||
if (!empty($value['exclude_select_element'])) {
|
||||
|
||||
@ -181,7 +181,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) {
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($object->budget_amount, '')) {
|
||||
if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
|
||||
print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -616,7 +616,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($object->budget_amount, '')) {
|
||||
if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
|
||||
print '<span class="amount">'.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -632,7 +632,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($object->budget_amount, '')) {
|
||||
if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
|
||||
print '<span class="amount">'.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1004,7 +1004,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($projectstatic->budget_amount, '')) {
|
||||
if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
|
||||
print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -2616,7 +2616,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
if (!count($tasks)) {
|
||||
$totalnboffields = 1;
|
||||
foreach ($arrayfields as $value) {
|
||||
if ($value['checked']) {
|
||||
if (!empty($value['checked'])) {
|
||||
$totalnboffields++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ class Ticket extends CommonObject
|
||||
'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'),
|
||||
'email_date' => array('type'=>'datetime', 'label'=>'EmailDate', 'visible'=>-2, 'enabled'=>1, 'position'=>541),
|
||||
'progress' => array('type'=>'integer', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>2, 'csslist'=>'width50'),
|
||||
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'$conf->global->TICKET_ENABLE_RESOLUTION', 'position'=>550, 'notnull'=>1),
|
||||
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'getDolGlobalString("TICKET_ENABLE_RESOLUTION")', 'position'=>550, 'notnull'=>1),
|
||||
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user