Clean code
This commit is contained in:
parent
2f7832ee44
commit
70e4705149
@ -937,7 +937,7 @@ if ($action == 'create') {
|
||||
$("#selectcomplete").change(function() {
|
||||
if ($("#selectcomplete").val() == 100)
|
||||
{
|
||||
if ($("#doneby").val() <= 0) $("#doneby").val(\''.$user->id.'\');
|
||||
if ($("#doneby").val() <= 0) $("#doneby").val(\''.((int) $user->id).'\');
|
||||
}
|
||||
if ($("#selectcomplete").val() == 0)
|
||||
{
|
||||
@ -992,7 +992,8 @@ if ($action == 'create') {
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
$default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
|
||||
$formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1);
|
||||
print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
|
||||
print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", -1, -1, 0, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -145,7 +145,7 @@ class CActionComm
|
||||
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
|
||||
* @param string $idorcode 'id' or 'code' or 'all'
|
||||
* @param string $excludetype Type to exclude ('system' or 'systemauto')
|
||||
* @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
|
||||
* @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1 or -2=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
|
||||
* @param string $morefilter Add more SQL filter
|
||||
* @param int $shortlabel 1=Get short label instead of long label
|
||||
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
|
||||
@ -241,7 +241,7 @@ class CActionComm
|
||||
$transcode = $langs->trans($keyfortrans);
|
||||
}
|
||||
$label = (($transcode != $keyfortrans) ? $transcode : $langs->trans($obj->label));
|
||||
if ($onlyautoornot == -1 && !empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
if (($onlyautoornot == -1 || $onlyautoornot == -2) && !empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
if ($typecalendar == 'system') {
|
||||
$label = ' '.$label;
|
||||
$repid[-99] = $langs->trans("ActionAC_MANUAL");
|
||||
|
||||
@ -352,7 +352,7 @@ class FormActions
|
||||
* @param array|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too.
|
||||
* @param string $htmlname Name of select field
|
||||
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
|
||||
* @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual"
|
||||
* @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual", -2=Combined line is disabled (not implemented yet)
|
||||
* @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value
|
||||
* @param int $multiselect 1=Allow multiselect of action type
|
||||
* @param int $nooutput 1=No output
|
||||
@ -373,7 +373,7 @@ class FormActions
|
||||
$caction = new CActionComm($this->db);
|
||||
|
||||
// Suggest a list with manual events or all auto events
|
||||
$arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
|
||||
$arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot, '', 0); // If we use param 'all' instead of 'code', there is no group by include in answer but the key 'type' of answer array contains the key for the group by.
|
||||
if (empty($multiselect)) {
|
||||
// Add empty line at start only if no multiselect
|
||||
array_unshift($arraylist, ' ');
|
||||
|
||||
@ -249,7 +249,7 @@ class Link extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
dol_syslog(get_class($this)."::fetchAll ".$num."records", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::fetchAll num=".((int) $num), LOG_DEBUG);
|
||||
if ($num > 0) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$link = new Link($this->db);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user