FIX Bad filter on opportunities

This commit is contained in:
Laurent Destailleur 2016-02-06 15:06:37 +01:00
parent 8f8c63e9c8
commit 3828fe7026
4 changed files with 22 additions and 4 deletions

View File

@ -137,6 +137,19 @@ With only message
tag 729538 +pending tag 729538 +pending
To remove status of a bug without "moreinfo" (bug can be processed)
or replay to email 999999@bugs.debian.org + submitter of bug
With a message starting with:
Control: tag -1 -moreinfo
Thanks. Fixed into git.
or replay to email control@bugs.debian.org
With only message
tag 729538 -moreinfo
##### Testing a package into unstable env ##### Testing a package into unstable env

View File

@ -535,14 +535,14 @@ class FormProjets
* Build a HTML select list of element of same thirdparty to suggest to link them to project * Build a HTML select list of element of same thirdparty to suggest to link them to project
* *
* @param string $htmlname HTML name * @param string $htmlname HTML name
* @param int $preselected Preselected * @param string $preselected Preselected (int or 'all' or 'none')
* @param int $showempty Add an empty line * @param int $showempty Add an empty line
* @param int $useshortlabel Use short label * @param int $useshortlabel Use short label
* @param int $showallnone Add choice "All" and "None" * @param int $showallnone Add choice "All" and "None"
* @param int $showpercent Show default probability for status * @param int $showpercent Show default probability for status
* @return int|string The HTML select list of element or '' if nothing or -1 if KO * @return int|string The HTML select list of element or '' if nothing or -1 if KO
*/ */
function selectOpportunityStatus($htmlname, $preselected=0, $showempty=1, $useshortlabel=0, $showallnone=0, $showpercent=0) function selectOpportunityStatus($htmlname, $preselected='-1', $showempty=1, $useshortlabel=0, $showallnone=0, $showpercent=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -560,8 +560,9 @@ class FormProjets
{ {
$sellist = '<select class="flat oppstatus" id="'.$htmlname.'" name="'.$htmlname.'">'; $sellist = '<select class="flat oppstatus" id="'.$htmlname.'" name="'.$htmlname.'">';
if ($showempty) $sellist.= '<option value="-1"></option>'; if ($showempty) $sellist.= '<option value="-1"></option>';
if ($showallnone) $sellist.= '<option value="all">--'.$langs->trans("Alls").'--</option>'; if ($showallnone) $sellist.= '<option value="all"'.($preselected == 'all'?' selected="selected"':'').'>--'.$langs->trans("OnlyOpportunitiesShort").'--</option>';
if ($showallnone) $sellist.= '<option value="none">--'.$langs->trans("None").'--</option>'; if ($showallnone) $sellist.= '<option value="openedopp"'.($preselected == 'openedopp'?' selected="selected"':'').'>--'.$langs->trans("OpenedOpportunitiesShort").'--</option>';
if ($showallnone) $sellist.= '<option value="none"'.($preselected == 'none'?' selected="selected"':'').'>--'.$langs->trans("NotAnOpportunityShort").'--</option>';
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);

View File

@ -183,6 +183,9 @@ TaskAssignedToEnterTime=Task assigned. Entering time on this task should be poss
IdTaskTime=Id task time IdTaskTime=Id task time
YouCanCompleteRef=If you want to complete the ref with some information (to use it as search filters), it is recommanded to add a - character to separate it, so the automatic numbering will still work correctly for next projects. For example %s-ABC. You may also prefer to add search keys into label. YouCanCompleteRef=If you want to complete the ref with some information (to use it as search filters), it is recommanded to add a - character to separate it, so the automatic numbering will still work correctly for next projects. For example %s-ABC. You may also prefer to add search keys into label.
OpenedProjectsByThirdparties=Opened projects by thirdparties OpenedProjectsByThirdparties=Opened projects by thirdparties
OnlyOpportunitiesShort=Only opportunities
OpenedOpportunitiesShort=Opened opportunities
NotAnOpportunityShort=Not an opportunity
OpportunityTotalAmount=Opportunities total amount OpportunityTotalAmount=Opportunities total amount
OpportunityPonderatedAmount=Opportunities weighted amount OpportunityPonderatedAmount=Opportunities weighted amount
OpportunityPonderatedAmountDesc=Opportunities amount weighted with probability OpportunityPonderatedAmountDesc=Opportunities amount weighted with probability

View File

@ -269,6 +269,7 @@ if ($search_opp_status)
{ {
if (is_numeric($search_opp_status) && $search_opp_status > 0) $sql .= " AND p.fk_opp_status = ".$db->escape($search_opp_status); if (is_numeric($search_opp_status) && $search_opp_status > 0) $sql .= " AND p.fk_opp_status = ".$db->escape($search_opp_status);
if ($search_opp_status == 'all') $sql .= " AND p.fk_opp_status IS NOT NULL"; if ($search_opp_status == 'all') $sql .= " AND p.fk_opp_status IS NOT NULL";
if ($search_opp_status == 'openedopp') $sql .= " AND p.fk_opp_status IS NOT NULL AND p.fk_opp_status NOT IN (SELECT rowid FROM ".MAIN_DB_PREFIX."c_lead_status WHERE code IN ('WIN','LOST'))";
if ($search_opp_status == 'none') $sql .= " AND p.fk_opp_status IS NULL"; if ($search_opp_status == 'none') $sql .= " AND p.fk_opp_status IS NULL";
} }
if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public); if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);