diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 520cb5d175a..a965d51ae74 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -395,7 +395,7 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); $form = new Form($db); -$htmlactions = new FormActions($db); +$formactions = new FormActions($db); if ($action == 'create') { @@ -467,7 +467,7 @@ if ($action == 'create') if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''.$langs->trans("Type").''; - $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); + $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); print ''; } else print ''; @@ -512,7 +512,7 @@ if ($action == 'create') if (GETPOST("afaire") == 1) $percent=0; else if (GETPOST("afaire") == 2) $percent=100; } - $htmlactions->form_select_status_action('formaction',$percent,1,'complete'); + $formactions->form_select_status_action('formaction',$percent,1,'complete'); print ''; // Location @@ -740,7 +740,7 @@ if ($id > 0) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''.$langs->trans("Type").''; - $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); + $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); print ''; } @@ -766,7 +766,7 @@ if ($id > 0) // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=GETPOST("percentage")?GETPOST("percentage"):$object->percentage; - $htmlactions->form_select_status_action('formaction',$percent,1); + $formactions->form_select_status_action('formaction',$percent,1); print ''; // Location diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 92b87d94ad1..044ded65d82 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -347,7 +347,10 @@ else $sql.= ')'; } if ($type) $sql.= " AND ca.id = ".$type; -if ($status == 'done') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } +if ($status == '0') { $sql.= " AND a.percent = 0"; } +if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable +if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running +if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($filtera > 0 || $filtert > 0 || $filterd > 0) { diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 48e21690d2a..da9534a0f07 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -153,7 +153,10 @@ 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 ($socid) $sql.= " AND s.rowid = ".$socid; if ($type) $sql.= " AND c.id = ".$type; -if ($status == 'done') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } +if ($status == '0') { $sql.= " AND a.percent = 0"; } +if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable +if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running +if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($filtera > 0 || $filtert > 0 || $filterd > 0) { diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 522b2c30662..81a7ea1f048 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -48,13 +48,15 @@ class FormActions /** * Show list of action status * - * @param string $formname Name of form where select in included - * @param string $selected Preselected value (-1..100) - * @param int $canedit 1=can edit, 0=read only - * @param string $htmlname Name of html prefix for html fields (selectX and valX) + * @param string $formname Name of form where select is included + * @param string $selected Preselected value (-1..100) + * @param int $canedit 1=can edit, 0=read only + * @param string $htmlname Name of html prefix for html fields (selectX and valX) + * @param string $showempty Show an empty line if select is used + * @param string $onlyselect 0=Standard, 1=Hide percent of completion and force usage of a select list, 2=Same than 1 and add "Incomplete (Todo+Running) * @return void */ - function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete') + function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete',$showempty=0,$onlyselect=0) { global $langs,$conf; @@ -64,6 +66,7 @@ class FormActions '50' => $langs->trans("ActionRunningShort"), '100' => $langs->trans("ActionDoneShort") ); + // +ActionUncomplete if (! empty($conf->use_javascript_ajax)) { @@ -112,18 +115,32 @@ class FormActions } } \n"; + } + if (! empty($conf->use_javascript_ajax) || $onlyselect) + { + //var_dump($selected); + if ($selected == 'done') $selected='100'; print ''; if ($selected == 0 || $selected == 100) $canedit=0; - print ' =0)?'':' disabled="disabled"').'>'; - print '%'; + + if (empty($onlyselect)) + { + print ' =0)?'':' disabled="disabled"').'>'; + print '%'; + } } else - { + { print ' %'; } } @@ -220,7 +237,7 @@ class FormActions global $langs,$user,$form; if (! is_object($form)) $form=new Form($db); - + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $caction=new CActionComm($this->db); diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 08aacfca14e..bdb068d71b5 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -43,8 +43,8 @@ * @param string $actioncode Preselected value of actioncode for filter on type * @return void */ -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='') { - +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='') +{ global $conf, $user, $langs, $db; // Filters @@ -87,13 +87,19 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions=new FormActions($db); + print ''; print ''; print $langs->trans("Type"); print '  '; - print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0)); + print ''; + print ''; + print ''; + print $langs->trans("Status"); + print '  '; + $formactions->form_select_status_action('formaction',$status,1,'complete',1,2); print ''; } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index caddad9d997..0f8851792b3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -356,6 +356,7 @@ ActionNotApplicable=Not applicable ActionRunningNotStarted=To start ActionRunningShort=Started ActionDoneShort=Finished +ActionUncomplete=Uncomplete CompanyFoundation=Company/Foundation ContactsForCompany=Contacts for this third party ContactsAddressesForCompany=Contacts/addresses for this third party diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 89c2589941b..4f13b1a1bad 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -355,6 +355,7 @@ ActionsDoneShort=Effectuées ActionNotApplicable=Non applicable ActionRunningNotStarted=A réaliser ActionRunningShort=En cours +ActionUncomplete=Incomplet ActionDoneShort=Terminé CompanyFoundation=Société ou institution ContactsForCompany=Contacts de ce tiers diff --git a/htdocs/langs/pt_BR/salaries.lang b/htdocs/langs/pt_BR/salaries.lang new file mode 100644 index 00000000000..ae54678cc61 --- /dev/null +++ b/htdocs/langs/pt_BR/salaries.lang @@ -0,0 +1,4 @@ +# Dolibarr language file - Source file is en_US - salaries +NewSalaryPayment=Novo pagamento de salário +SalaryPayment=Pagamento de salário +SalariesPayments=Pagamentos de salários