Fix phpcs
This commit is contained in:
parent
358bb87ae2
commit
97292d6843
@ -207,12 +207,12 @@ if ($action == 'edit') {
|
|||||||
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
foreach ($arrayofparameters as $constname => $val) {
|
foreach ($arrayofparameters as $constname => $val) {
|
||||||
if ($val['enabled']==1) {
|
if ($val['enabled']==1) {
|
||||||
$setupnotempty++;
|
$setupnotempty++;
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||||
print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
|
print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
|
|
||||||
if ($val['type'] == 'textarea') {
|
if ($val['type'] == 'textarea') {
|
||||||
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||||
@ -257,13 +257,13 @@ if ($action == 'edit') {
|
|||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||||
} elseif ($val['type'] == 'securekey') {
|
} elseif ($val['type'] == 'securekey') {
|
||||||
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
|
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
|
||||||
}
|
}
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print "\n".'<script type="text/javascript">';
|
print "\n".'<script type="text/javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#generate_token'.$constname.'").click(function() {
|
$("#generate_token'.$constname.'").click(function() {
|
||||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
||||||
action: \'getrandompassword\',
|
action: \'getrandompassword\',
|
||||||
@ -274,8 +274,8 @@ if ($action == 'edit') {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>';
|
print '</script>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -572,99 +572,99 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
dol_syslog(get_class($this)."::valid");
|
dol_syslog(get_class($this)."::valid");
|
||||||
$result = 0;
|
$result = 0;
|
||||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->commande->creer) || !empty($user->rights->supplier_order->creer)))
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->commande->creer) || !empty($user->rights->supplier_order->creer)))
|
||||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) {
|
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) {
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Definition of supplier order numbering model name
|
// Definition of supplier order numbering model name
|
||||||
$soc = new Societe($this->db);
|
$soc = new Societe($this->db);
|
||||||
$soc->fetch($this->fourn_id);
|
$soc->fetch($this->fourn_id);
|
||||||
|
|
||||||
// Check if object has a temporary ref
|
// Check if object has a temporary ref
|
||||||
if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life
|
if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life
|
||||||
$num = $this->getNextNumRef($soc);
|
$num = $this->getNextNumRef($soc);
|
||||||
} else {
|
} else {
|
||||||
$num = $this->ref;
|
$num = $this->ref;
|
||||||
}
|
}
|
||||||
$this->newref = dol_sanitizeFileName($num);
|
$this->newref = dol_sanitizeFileName($num);
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur";
|
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur";
|
||||||
$sql .= " SET ref='".$this->db->escape($num)."',";
|
$sql .= " SET ref='".$this->db->escape($num)."',";
|
||||||
$sql .= " fk_statut = ".self::STATUS_VALIDATED.",";
|
$sql .= " fk_statut = ".self::STATUS_VALIDATED.",";
|
||||||
$sql .= " date_valid='".$this->db->idate(dol_now())."',";
|
$sql .= " date_valid='".$this->db->idate(dol_now())."',";
|
||||||
$sql .= " fk_user_valid = ".$user->id;
|
$sql .= " fk_user_valid = ".$user->id;
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
$sql .= " AND fk_statut = ".self::STATUS_DRAFT;
|
$sql .= " AND fk_statut = ".self::STATUS_DRAFT;
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error && !$notrigger) {
|
|
||||||
// Call trigger
|
|
||||||
$result = $this->call_trigger('ORDER_SUPPLIER_VALIDATE', $user);
|
|
||||||
if ($result < 0) {
|
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
// End call triggers
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error && !$notrigger) {
|
||||||
$this->oldref = $this->ref;
|
// Call trigger
|
||||||
|
$result = $this->call_trigger('ORDER_SUPPLIER_VALIDATE', $user);
|
||||||
// Rename directory if dir was a temporary ref
|
if ($result < 0) {
|
||||||
if (preg_match('/^[\(]?PROV/i', $this->ref)) {
|
$error++;
|
||||||
// Now we rename also files into index
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'fournisseur/commande/".$this->db->escape($this->newref)."'";
|
|
||||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if (!$resql) {
|
|
||||||
$error++; $this->error = $this->db->lasterror();
|
|
||||||
}
|
}
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
if (!$error) {
|
||||||
$oldref = dol_sanitizeFileName($this->ref);
|
$this->oldref = $this->ref;
|
||||||
$newref = dol_sanitizeFileName($num);
|
|
||||||
$dirsource = $conf->fournisseur->commande->dir_output.'/'.$oldref;
|
|
||||||
$dirdest = $conf->fournisseur->commande->dir_output.'/'.$newref;
|
|
||||||
if (!$error && file_exists($dirsource)) {
|
|
||||||
dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest);
|
|
||||||
|
|
||||||
if (@rename($dirsource, $dirdest)) {
|
// Rename directory if dir was a temporary ref
|
||||||
dol_syslog("Rename ok");
|
if (preg_match('/^[\(]?PROV/i', $this->ref)) {
|
||||||
// Rename docs starting with $oldref with $newref
|
// Now we rename also files into index
|
||||||
$listoffiles = dol_dir_list($conf->fournisseur->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
|
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'fournisseur/commande/".$this->db->escape($this->newref)."'";
|
||||||
foreach ($listoffiles as $fileentry) {
|
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||||
$dirsource = $fileentry['name'];
|
$resql = $this->db->query($sql);
|
||||||
$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
|
if (!$resql) {
|
||||||
$dirsource = $fileentry['path'].'/'.$dirsource;
|
$error++; $this->error = $this->db->lasterror();
|
||||||
$dirdest = $fileentry['path'].'/'.$dirdest;
|
}
|
||||||
@rename($dirsource, $dirdest);
|
|
||||||
|
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||||
|
$oldref = dol_sanitizeFileName($this->ref);
|
||||||
|
$newref = dol_sanitizeFileName($num);
|
||||||
|
$dirsource = $conf->fournisseur->commande->dir_output.'/'.$oldref;
|
||||||
|
$dirdest = $conf->fournisseur->commande->dir_output.'/'.$newref;
|
||||||
|
if (!$error && file_exists($dirsource)) {
|
||||||
|
dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest);
|
||||||
|
|
||||||
|
if (@rename($dirsource, $dirdest)) {
|
||||||
|
dol_syslog("Rename ok");
|
||||||
|
// Rename docs starting with $oldref with $newref
|
||||||
|
$listoffiles = dol_dir_list($conf->fournisseur->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
|
||||||
|
foreach ($listoffiles as $fileentry) {
|
||||||
|
$dirsource = $fileentry['name'];
|
||||||
|
$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
|
||||||
|
$dirsource = $fileentry['path'].'/'.$dirsource;
|
||||||
|
$dirdest = $fileentry['path'].'/'.$dirdest;
|
||||||
|
@rename($dirsource, $dirdest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$result = 1;
|
$result = 1;
|
||||||
$this->statut = self::STATUS_VALIDATED;
|
$this->statut = self::STATUS_VALIDATED;
|
||||||
$this->ref = $num;
|
$this->ref = $num;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->db->rollback();
|
$this->error = 'NotAuthorized';
|
||||||
|
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$this->error = 'NotAuthorized';
|
|
||||||
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1371,7 +1371,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$this->lines[$i]->date_end,
|
$this->lines[$i]->date_end,
|
||||||
$this->lines[$i]->array_options,
|
$this->lines[$i]->array_options,
|
||||||
$this->lines[$i]->fk_unit
|
$this->lines[$i]->fk_unit
|
||||||
);
|
);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error
|
dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
@ -2708,7 +2708,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if ($qty < $this->line->packaging) {
|
if ($qty < $this->line->packaging) {
|
||||||
$qty = $this->line->packaging;
|
$qty = $this->line->packaging;
|
||||||
} else {
|
} else {
|
||||||
if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) {
|
if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) {
|
||||||
$coeff = intval($qty / $this->line->packaging) + 1;
|
$coeff = intval($qty / $this->line->packaging) + 1;
|
||||||
$qty = $this->line->packaging * $coeff;
|
$qty = $this->line->packaging * $coeff;
|
||||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||||
|
|||||||
@ -81,7 +81,7 @@ $arrayofparameters = array(
|
|||||||
//'MYMODULE_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1),
|
//'MYMODULE_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1),
|
||||||
//'MYMODULE_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1),
|
//'MYMODULE_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1),
|
||||||
//'MYMODULE_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1),
|
//'MYMODULE_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1),
|
||||||
//'MYMODULE_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1),
|
//'MYMODULE_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1),
|
||||||
);
|
);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -278,13 +278,13 @@ if ($action == 'edit') {
|
|||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||||
} elseif ($val['type'] == 'securekey') {
|
} elseif ($val['type'] == 'securekey') {
|
||||||
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
|
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
|
||||||
}
|
}
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print "\n".'<script type="text/javascript">';
|
print "\n".'<script type="text/javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#generate_token'.$constname.'").click(function() {
|
$("#generate_token'.$constname.'").click(function() {
|
||||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
||||||
action: \'getrandompassword\',
|
action: \'getrandompassword\',
|
||||||
@ -295,8 +295,8 @@ if ($action == 'edit') {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>';
|
print '</script>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,21 +118,21 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
|
|
||||||
$arrayfields = array();
|
$arrayfields = array();
|
||||||
/*$arrayfields=array(
|
/*$arrayfields=array(
|
||||||
// Project
|
// Project
|
||||||
'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>103),
|
'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>103),
|
||||||
'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104),
|
'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104),
|
||||||
'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105),
|
'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105),
|
||||||
'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110),
|
'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110),
|
||||||
'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115),
|
'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115),
|
||||||
);*/
|
);*/
|
||||||
$arrayfields['t.planned_workload'] = array('label'=>'PlannedWorkload', 'checked'=>1, 'enabled'=>1, 'position'=>5);
|
$arrayfields['t.planned_workload'] = array('label'=>'PlannedWorkload', 'checked'=>1, 'enabled'=>1, 'position'=>5);
|
||||||
$arrayfields['t.progress'] = array('label'=>'ProgressDeclared', 'checked'=>1, 'enabled'=>1, 'position'=>10);
|
$arrayfields['t.progress'] = array('label'=>'ProgressDeclared', 'checked'=>1, 'enabled'=>1, 'position'=>10);
|
||||||
$arrayfields['timeconsumed'] = array('label'=>'TimeConsumed', 'checked'=>1, 'enabled'=>1, 'position'=>15);
|
$arrayfields['timeconsumed'] = array('label'=>'TimeConsumed', 'checked'=>1, 'enabled'=>1, 'position'=>15);
|
||||||
/*foreach($object->fields as $key => $val)
|
/*foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
// If $val['visible']==0, then we never show the field
|
// If $val['visible']==0, then we never show the field
|
||||||
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
||||||
}*/
|
}*/
|
||||||
// Definition of fields for list
|
// Definition of fields for list
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attributes['projet_task']['label']) && count($extrafields->attributes['projet_task']['label']) > 0) {
|
if (is_array($extrafields->attributes['projet_task']['label']) && count($extrafields->attributes['projet_task']['label']) > 0) {
|
||||||
@ -333,9 +333,9 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac
|
|||||||
$param .= ($search_task_label ? '&search_task_label='.urlencode($search_task_label) : '');
|
$param .= ($search_task_label ? '&search_task_label='.urlencode($search_task_label) : '');
|
||||||
|
|
||||||
/*$search_array_options=$search_array_options_project;
|
/*$search_array_options=$search_array_options_project;
|
||||||
$search_options_pattern='search_options_';
|
$search_options_pattern='search_options_';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$search_array_options = $search_array_options_task;
|
$search_array_options = $search_array_options_task;
|
||||||
$search_options_pattern = 'search_task_options_';
|
$search_options_pattern = 'search_task_options_';
|
||||||
@ -394,11 +394,11 @@ if ($search_declared_progress) {
|
|||||||
$sql = &$morewherefilter;
|
$sql = &$morewherefilter;
|
||||||
|
|
||||||
/*$search_array_options = $search_array_options_project;
|
/*$search_array_options = $search_array_options_project;
|
||||||
$extrafieldsobjectprefix='efp.';
|
$extrafieldsobjectprefix='efp.';
|
||||||
$search_options_pattern='search_options_';
|
$search_options_pattern='search_options_';
|
||||||
$extrafieldsobjectkey='projet';
|
$extrafieldsobjectkey='projet';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
*/
|
*/
|
||||||
$search_array_options = $search_array_options_task;
|
$search_array_options = $search_array_options_task;
|
||||||
$extrafieldsobjectprefix = 'efpt.';
|
$extrafieldsobjectprefix = 'efpt.';
|
||||||
$search_options_pattern = 'search_task_options_';
|
$search_options_pattern = 'search_task_options_';
|
||||||
@ -540,14 +540,14 @@ $moreforfilter = '';
|
|||||||
|
|
||||||
// Filter on categories
|
// Filter on categories
|
||||||
/*
|
/*
|
||||||
if (! empty($conf->categorie->enabled))
|
if (! empty($conf->categorie->enabled))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.=$langs->trans('ProjectCategories'). ': ';
|
$moreforfilter.=$langs->trans('ProjectCategories'). ': ';
|
||||||
$moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 1, 'maxwidth300');
|
$moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 1, 'maxwidth300');
|
||||||
$moreforfilter.='</div>';
|
$moreforfilter.='</div>';
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// If the user can view user other than himself
|
// If the user can view user other than himself
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
@ -806,7 +806,7 @@ if (count($tasksarray) > 0) {
|
|||||||
|
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td class="liste_total" colspan="'.($colspan + $addcolspan).'">';
|
print '<td class="liste_total" colspan="'.($colspan + $addcolspan).'">';
|
||||||
print $langs->trans("Total");
|
print $langs->trans("Total");
|
||||||
print '<span class="opacitymediumbycolor"> - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong></span>';
|
print '<span class="opacitymediumbycolor"> - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong></span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -835,7 +835,7 @@ if (count($tasksarray) > 0) {
|
|||||||
print '<td class="liste_total hide'.$idw.($cssonholiday ? ' '.$cssonholiday : '').($cssweekend ? ' '.$cssweekend : '').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
print '<td class="liste_total hide'.$idw.($cssonholiday ? ' '.$cssonholiday : '').($cssweekend ? ' '.$cssweekend : '').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||||
}
|
}
|
||||||
print '<td class="liste_total center"><div class="totalDayAll"> </div></td>';
|
print '<td class="liste_total center"><div class="totalDayAll"> </div></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';
|
print '<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans("NoAssignedTasks").'</span></td></tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user