Some debug on new features

This commit is contained in:
Laurent Destailleur 2015-12-04 20:51:34 +01:00
parent eb795a7a9d
commit 5cd43d2df0
15 changed files with 48 additions and 31 deletions

View File

@ -101,11 +101,12 @@ class CActionComm
* *
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter) * @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' * @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude * @param string $excludetype Type to exclude ('system' or 'systemauto')
* @param int $onlyautoornot Group list by auto events or not * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type
* @param string $morefilter Add more SQL filter
* @return mixed Array of all event types if OK, <0 if KO * @return mixed Array of all event types if OK, <0 if KO
*/ */
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0) function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='')
{ {
global $langs,$conf; global $langs,$conf;
$langs->load("commercial"); $langs->load("commercial");
@ -115,8 +116,10 @@ class CActionComm
$sql = "SELECT id, code, libelle, module, type, color"; $sql = "SELECT id, code, libelle, module, type, color";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
if ($active != '') $sql.=" WHERE active=".$active; $sql.= " WHERE 1=1";
if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'"; if ($active != '') $sql.=" AND active=".$active;
if (! empty($excludetype)) $sql.=" AND type <> '".$excludetype."'";
if ($morefilter) $sql.=" AND ".$morefilter;
$sql.= " ORDER BY module, position"; $sql.= " ORDER BY module, position";
dol_syslog(get_class($this)."::liste_array", LOG_DEBUG); dol_syslog(get_class($this)."::liste_array", LOG_DEBUG);

View File

@ -951,7 +951,7 @@ if (empty($action) || $action == 'show_month') // View by month
$newparam=preg_replace('/viewcal=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/viewcal=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter
$newparam.='&viewcal=1'; $newparam.='&viewcal=1';
echo '<table width="100%" class="noborder nocellnopadd cal_month">'; echo '<table width="100%" class="noborder nocellnopadd cal_pannel cal_month">';
echo ' <tr class="liste_titre">'; echo ' <tr class="liste_titre">';
$i=0; $i=0;
while ($i < 7) while ($i < 7)
@ -1028,7 +1028,7 @@ elseif ($action == 'show_week') // View by week
$newparam=preg_replace('/viewweek=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/viewweek=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter
$newparam.='&viewweek=1'; $newparam.='&viewweek=1';
echo '<table width="100%" class="noborder nocellnopadd cal_month">'; echo '<table width="100%" class="noborder nocellnopadd cal_pannel cal_month">';
echo ' <tr class="liste_titre">'; echo ' <tr class="liste_titre">';
$i=0; $i=0;
while ($i < 7) while ($i < 7)
@ -1085,7 +1085,7 @@ else // View by day
$timestamp=dol_mktime(12,0,0,$month,$day,$year); $timestamp=dol_mktime(12,0,0,$month,$day,$year);
$arraytimestamp=dol_getdate($timestamp); $arraytimestamp=dol_getdate($timestamp);
echo '<table width="100%" class="noborder nocellnopadd cal_month">'; echo '<table width="100%" class="noborder nocellnopadd cal_pannel cal_month">';
echo ' <tr class="liste_titre">'; echo ' <tr class="liste_titre">';
echo ' <td align="center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n"; echo ' <td align="center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
echo " </tr>\n"; echo " </tr>\n";

View File

@ -39,17 +39,23 @@ $action=GETPOST('action','alpha');
$year=GETPOST("year",'int'); $year=GETPOST("year",'int');
$month=GETPOST("month",'int'); $month=GETPOST("month",'int');
$day=GETPOST("day",'int'); $day=GETPOST("day",'int');
$actioncode=GETPOST("actioncode","alpha",3);
$pid=GETPOST("projectid",'int',3); $pid=GETPOST("projectid",'int',3);
$status=GETPOST("status",'alpha'); $status=GETPOST("status",'alpha');
$type=GETPOST('type'); $type=GETPOST('type');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
if (GETPOST('actioncode','array'))
{
$actioncode=GETPOST('actioncode','array',3);
if (! count($actioncode)) $actioncode='0';
}
else
{
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
}
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); $dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear')); $datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear'));
$dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear')); $dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear'));
if (empty($actioncode) && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
@ -136,7 +142,7 @@ $userstatic=new User($db);
$nav=''; $nav='';
$nav.='<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">'; $nav.='<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
if ($optioncss != '') $nav.= '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') $nav.= '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">'; if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.='<input type="hidden" name="status" value="'.$status.'">'; if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.='<input type="hidden" name="status" value="'.$status.'">';
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">'; if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">'; if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
@ -158,7 +164,7 @@ llxHeader('',$langs->trans("Agenda"),$help_url);
$listofextcals=array(); $listofextcals=array();
$param=''; $param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; if ($actioncode) $param.="&actioncode=".$actioncode;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
if ($filtert) $param.="&filtert=".$filtert; if ($filtert) $param.="&filtert=".$filtert;
@ -186,7 +192,7 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
$sql.= " WHERE c.id = a.fk_action"; $sql.= " WHERE c.id = a.fk_action";
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'"; if ($actioncode) $sql.=" AND c.code IN ('".$db->escape($actioncode)."')";
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= " AND s.rowid = ".$socid; if ($socid > 0) $sql.= " AND s.rowid = ".$socid;

View File

@ -278,7 +278,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param);
$head = calendars_prepare_head($paramnoaction); $head = calendars_prepare_head($paramnoaction);
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup); print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, 'systemauto');
dol_fiche_end(); dol_fiche_end();
$showextcals=$listofextcals; $showextcals=$listofextcals;

View File

@ -244,10 +244,10 @@ class FormActions
* *
* @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx') * @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx')
* @param string $htmlname Nom champ formulaire * @param string $htmlname Nom champ formulaire
* @param string $excludetype Type to exclude * @param string $excludetype A type to exclude ('systemauto', 'system', '')
* @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) * @param string $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type
* @param int $hideinfohelp 1=Do not show info help * @param int $hideinfohelp 1=Do not show info help
* @param int $multiselect 1=Allow multiselect of action type for filter or search * @param int $multiselect 1=Allow multiselect of action type
* @return void * @return void
*/ */
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0) function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0)
@ -270,17 +270,16 @@ class FormActions
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']); if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']);
if ($multiselect==1) if (! empty($multiselect))
{ {
if(!is_array($selected) && !empty($selected)) $selected = explode(',', $selected); if(!is_array($selected) && !empty($selected)) $selected = explode(',', $selected);
print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, '', 0, 0); print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
} }
else { else
{
print $form->selectarray($htmlname, $arraylist, $selected); print $form->selectarray($htmlname, $arraylist, $selected);
} }
if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
} }

View File

@ -41,11 +41,12 @@
* @param int $socid Third party id * @param int $socid Third party id
* @param string $action Action string * @param string $action Action string
* @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend * @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend
* @param string $actioncode Preselected value of actioncode for filter on type * @param string|array $actioncode Preselected value(s) of actioncode for filter on type
* @param int $usergroupid Id of group to filter on users * @param int $usergroupid Id of group to filter on users
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
* @return void * @return void
*/ */
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='') function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='')
{ {
global $conf, $user, $langs, $db, $hookmanager; global $conf, $user, $langs, $db, $hookmanager;
global $begin_h, $end_h, $begin_d, $end_d; global $begin_h, $end_h, $begin_d, $end_d;
@ -87,8 +88,12 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
print $langs->trans("Type"); print $langs->trans("Type");
print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">'; print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">';
//select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=true) $multiselect=0;
print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), 0, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?0:1)); if (! empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
{
$multiselect=(!empty($conf->global->AGENDA_USE_EVENT_TYPE));
}
print $formactions->select_type_actions($actioncode, "actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), 0, $multiselect);
print '</td></tr>'; print '</td></tr>';
// Status // Status

View File

@ -2936,6 +2936,8 @@ td.hidden {
/* ============================================================================== */ /* ============================================================================== */
table.cal_month { border-spacing: 0px; } table.cal_month { border-spacing: 0px; }
table.cal_month td:first-child { border-left: 0px; }
table.cal_month td:last-child { border-right: 0px; }
.cal_current_month { border-top: 0; border-left: solid 1px #E0E0E0; border-right: 0; border-bottom: solid 1px #E0E0E0; } .cal_current_month { border-top: 0; border-left: solid 1px #E0E0E0; border-right: 0; border-bottom: solid 1px #E0E0E0; }
.cal_current_month_peruserleft { border-top: 0; border-left: solid 3px #6C7C7B; border-right: 0; border-bottom: solid 1px #E0E0E0; } .cal_current_month_peruserleft { border-top: 0; border-left: solid 3px #6C7C7B; border-right: 0; border-bottom: solid 1px #E0E0E0; }
.cal_current_month_oneday { border-right: solid 1px #E0E0E0; } .cal_current_month_oneday { border-right: solid 1px #E0E0E0; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 392 B

View File

@ -2807,6 +2807,8 @@ td.hidden {
/* ============================================================================== */ /* ============================================================================== */
table.cal_month { border-spacing: 0px; } table.cal_month { border-spacing: 0px; }
table.cal_month td:first-child { border-left: 0px; }
table.cal_month td:last-child { border-right: 0px; }
.cal_current_month { border-top: 0; border-left: solid 1px #E0E0E0; border-right: 0; border-bottom: solid 1px #E0E0E0; } .cal_current_month { border-top: 0; border-left: solid 1px #E0E0E0; border-right: 0; border-bottom: solid 1px #E0E0E0; }
.cal_current_month_peruserleft { border-top: 0; border-left: solid 3px #6C7C7B; border-right: 0; border-bottom: solid 1px #E0E0E0; } .cal_current_month_peruserleft { border-top: 0; border-left: solid 3px #6C7C7B; border-right: 0; border-bottom: solid 1px #E0E0E0; }
.cal_current_month_oneday { border-right: solid 1px #E0E0E0; } .cal_current_month_oneday { border-right: solid 1px #E0E0E0; }