Merge pull request #946 from FHenry/develop

[ task #892 ] Add option in thridparty customer/supplier admin to hide
This commit is contained in:
Laurent Destailleur 2013-05-17 00:54:21 -07:00
commit 7d8d4a33bf
19 changed files with 381 additions and 179 deletions

View File

@ -4,8 +4,10 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.5 compared to 3.4 ***** ***** ChangeLog for 3.5 compared to 3.4 *****
For users: For users:
- New: [ task #877 ] Reorganize some menus. - New: [ task #877 ] Reorganize menus
- New: [ task #858 ] Holiday module: note on manual holiday assignation. - New: [ task #858 ] Holiday module: note on manual holiday assignation
- New: [ task #892 ] Add option in thridparty customer/supplier admin to hide non active in select_company method
- New: [ task #531 ] Add a workload on tasks
- New: Add graph of bank account input/output into input-output report page. - New: Add graph of bank account input/output into input-output report page.
- New: Add script export-bank-receipts. - New: Add script export-bank-receipts.
- New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge - New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge
@ -13,7 +15,6 @@ For users:
For developers: For developers:
- New: DolGraph can build graph with three lines. - New: DolGraph can build graph with three lines.
***** ChangeLog for 3.4 compared to 3.3.2 ***** ***** ChangeLog for 3.4 compared to 3.3.2 *****
For users: For users:
- New: Can use ODS templates as document templates. - New: Can use ODS templates as document templates.
@ -103,32 +104,31 @@ WARNING: If you used external modules, some of them may need to be upgraded due
***** ChangeLog for 3.3.2 compared to 3.3.1 ***** ***** ChangeLog for 3.3.2 compared to 3.3.1 *****
- Fix: Dutch (nl_NL) translation. - Fix: Dutch (nl_NL) translation
- Generalize fix: file with a specific mask not found, again. - Generalize fix: file with a specific mask not found, again
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger. - Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
- Fix: Can't reset payment due date. - Fix: Can't reset payment due date
- Fix: Orderstoinvoice didn't act as expected when no order was checked. - Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect. - Fix: Bad link to all proposals into Third party card if customer is prospect
- Fix: Some bugs on withdrawal rejects. - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed. - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment. - Fix: [ bug #789 ] VAT not being calculated in POS
- Fix: [ bug #789 ] VAT not being calculated in POS. - Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated. - Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list. - Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price. - Fix: [ bug #810 ] Cannot update ODT template path
- Fix: [ bug #810 ] Cannot update ODT template path. - Fix: [ bug #816 ] Sales journal does not reflect localtaxes
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes. - Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes. - Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary. - Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres). - Fix: [ bug #855 ] Holiday approval email in French
- Fix: [ bug #855 ] Holiday approval email in French. - Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email. - Fix: [ bug #857 ] Invoice created from shipment does not have the order discount
- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount. - Fix: [ bug #861 ] Impossible to create a new event in agenda
- Fix: [ bug #861 ] Impossible to create a new event in agenda. - Fix: [ bug #827 ] AJAX search does not respect multiprice level
- Fix: [ bug #827 ] AJAX search does not respect multiprice level. - Fix: [ bug #865 ] Dolibarr navigation array in project/task do not work
- Fix: [ bug #865 ] Dolibarr navigation array in project/task do not work. - Fix: [ bug #866 ] Standing order from an invoice suggests invoice total amount instead of remaining to pay
- Fix: [ bug #866 ] Standing order from an invoice suggests invoice total amount instead of remaining to pay. - Fix: [ bug #788 ] Date of linked interventions are not shown
- Fix: [ bug #788 ] Date of linked interventions are not shown.
***** ChangeLog for 3.3.1 compared to 3.3 ***** ***** ChangeLog for 3.3.1 compared to 3.3 *****

View File

@ -681,6 +681,7 @@ class Form
if (! empty($user->societe_id)) $sql.= " AND s.rowid = ".$user->societe_id; if (! empty($user->societe_id)) $sql.= " AND s.rowid = ".$user->societe_id;
if ($filter) $sql.= " AND (".$filter.")"; if ($filter) $sql.= " AND (".$filter.")";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status<>0 ";
$sql.= " ORDER BY nom ASC"; $sql.= " ORDER BY nom ASC";
dol_syslog(get_class($this)."::select_company sql=".$sql); dol_syslog(get_class($this)."::select_company sql=".$sql);
@ -3517,10 +3518,13 @@ class Form
* @param string $prefix prefix * @param string $prefix prefix
* @param int $iSecond Default preselected duration (number of seconds) * @param int $iSecond Default preselected duration (number of seconds)
* @param int $disabled Disable the combo box * @param int $disabled Disable the combo box
* @param string $typehour if select then hour in select if text input in text
* @return void * @return void
*/ */
function select_duration($prefix,$iSecond='',$disabled=0) function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select')
{ {
global $langs;
if ($iSecond) if ($iSecond)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@ -3529,6 +3533,8 @@ class Form
$minSelected = convertSecondToTime($iSecond,'min'); $minSelected = convertSecondToTime($iSecond,'min');
} }
if ($typehour=='select')
{
print '<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>'; print '<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>';
for ($hour = 0; $hour < 24; $hour++) for ($hour = 0; $hour < 24; $hour++)
{ {
@ -3540,7 +3546,13 @@ class Form
print ">".$hour."</option>"; print ">".$hour."</option>";
} }
print "</select>"; print "</select>";
print "H &nbsp;"; }
elseif ($typehour=='text')
{
$fullhours=convertSecondToTime($iSecond,'fullhour');
print '<input type="text" size="3" name="'.$prefix.'hour" class="flat" value="'.$fullhours.'">';
}
print $langs->trans('Hours'). "&nbsp;";
print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>'; print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>';
for ($min = 0; $min <= 55; $min=$min+5) for ($min = 0; $min <= 55; $min=$min+5)
{ {
@ -3549,7 +3561,7 @@ class Form
print '>'.$min.'</option>'; print '>'.$min.'</option>';
} }
print "</select>"; print "</select>";
print "M&nbsp;"; print $langs->trans('Minutes'). "&nbsp;";
} }

View File

@ -287,6 +287,16 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
{ {
$sTime=dol_print_date($iSecond,'%H',true); $sTime=dol_print_date($iSecond,'%H',true);
} }
else if ($format == 'fullhour')
{
if (!empty($iSecond)) {
$iSecond=$iSecond/3600;
}
else {
$iSecond=0;
}
$sTime=$iSecond;
}
else if ($format == 'min') else if ($format == 'min')
{ {
$sTime=dol_print_date($iSecond,'%M',true); $sTime=dol_print_date($iSecond,'%M',true);

View File

@ -420,6 +420,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print dol_print_date($lines[$i]->date_end,'day'); print dol_print_date($lines[$i]->date_end,'day');
print '</td>'; print '</td>';
// Planned Workload
print '<td align="center">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'all');
else print '--:--';
print '</td>';
// Progress // Progress
print '<td align="right">'; print '<td align="right">';
print $lines[$i]->progress.' %'; print $lines[$i]->progress.' %';
@ -466,6 +472,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>';
if ($addordertick) print '<td class="hideonsmartphone"></td>'; if ($addordertick) print '<td class="hideonsmartphone"></td>';
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td>'; print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td>';
print '</tr>'; print '</tr>';
@ -549,6 +556,12 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
print dol_print_date($lines[$i]->date_end,'day'); print dol_print_date($lines[$i]->date_end,'day');
print '</td>'; print '</td>';
// Planned Workload
print '<td align="center">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'all');
else print '--:--';
print '</td>';
// Progress // Progress
print '<td align="right">'; print '<td align="right">';
print $lines[$i]->progress.' %'; print $lines[$i]->progress.' %';

View File

@ -157,18 +157,18 @@ class modProjet extends DolibarrModules
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country', $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote", 'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote",
'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.duration_planned'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc"); 'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc");
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.duration_planned'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text"); 'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company', $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company', 's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project", 'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project",
'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.duration_planned'=>"task",'pt.progress'=>"task",'pt.description'=>"task"); 'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.planned_workload'=>"task",'pt.progress'=>"task",'pt.description'=>"task");
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'projet_task as pt, '.MAIN_DB_PREFIX.'societe as s)'; $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'projet_task as pt, '.MAIN_DB_PREFIX.'societe as s)';

View File

@ -116,6 +116,15 @@ class modSociete extends DolibarrModules
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
/*
$this->const[$r][0] = "COMPANY_HIDE_INACTIVE_IN_COMBOBOX";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "0";
$this->const[$r][3] = "hide thirdparty customer inative in combobox";
$this->const[$r][4] = 1;
$r++;
*/
// Boxes // Boxes
$this->boxes = array(); $this->boxes = array();
$r=0; $r=0;

View File

@ -19,3 +19,7 @@
DELETE FROM llx_menu where module='holiday'; DELETE FROM llx_menu where module='holiday';
ALTER TABLE llx_projet_task ADD COLUMN planned_workload real DEFAULT 0 NOT NULL AFTER duration_effective;

View File

@ -30,6 +30,7 @@ create table llx_projet_task
label varchar(255) NOT NULL, label varchar(255) NOT NULL,
description text, description text,
duration_effective real DEFAULT 0 NOT NULL, duration_effective real DEFAULT 0 NOT NULL,
planned_workload real DEFAULT 0 NOT NULL,
progress integer DEFAULT 0, -- percentage increase progress integer DEFAULT 0, -- percentage increase
priority integer DEFAULT 0, -- priority priority integer DEFAULT 0, -- priority
fk_user_creat integer, -- user who created the task fk_user_creat integer, -- user who created the task

View File

@ -53,6 +53,7 @@ ConfirmAjax=Use Ajax confirmation popups
UseSearchToSelectCompany=Use autocompletion fields to choose third parties (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant SOCIETE_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectCompany=Use autocompletion fields to choose third parties (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant SOCIETE_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
ActivityStateToSelectCompany= Add a filter option to show/hide thirdparties which are currently in activity or has ceased it ActivityStateToSelectCompany= Add a filter option to show/hide thirdparties which are currently in activity or has ceased it
UseSearchToSelectContact=Use autocompletion fields to choose contact (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectContact=Use autocompletion fields to choose contact (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
HideClosedThirdpartyComboBox=Hide Third party with Status to Closed into customer select list (or combobox)
SearchFilter=Search filters options SearchFilter=Search filters options
NumberOfKeyToSearch=Nbr of characters to trigger search: %s NumberOfKeyToSearch=Nbr of characters to trigger search: %s
ViewFullDateActions=Show full dates events in the third sheet ViewFullDateActions=Show full dates events in the third sheet

View File

@ -105,3 +105,5 @@ TypeContact_project_task_internal_CONTRIBUTOR=Contributor
TypeContact_project_task_external_CONTRIBUTOR=Contributor TypeContact_project_task_external_CONTRIBUTOR=Contributor
# Documents models # Documents models
DocumentModelBaleine=A complete project's report model (logo...) DocumentModelBaleine=A complete project's report model (logo...)
PlannedWorkload = Planned workload
WorkloadOccupation= Workload affectation

View File

@ -52,6 +52,7 @@ ConfirmAjax= Utiliser les popups de confirmation Ajax
UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de tiers (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine. UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de tiers (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
ActivityStateToSelectCompany= Ajouter une option de filtrage lors des recherches pour afficher/masquer les tiers en exercice ou ayant cessés d'exercer ActivityStateToSelectCompany= Ajouter une option de filtrage lors des recherches pour afficher/masquer les tiers en exercice ou ayant cessés d'exercer
UseSearchToSelectContact= Utiliser un champ avec autocomplétion pour choisir un contact (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de contacts (> 100 000), vous pouvez améliorer les performances en définissant la constante CONTACT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine. UseSearchToSelectContact= Utiliser un champ avec autocomplétion pour choisir un contact (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de contacts (> 100 000), vous pouvez améliorer les performances en définissant la constante CONTACT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
HideClosedThirdpartyComboBox=Ne pas afficher les clients à l'état "Clos" dans les listes déroulantes (ou champ avec autocomplétion)
SearchFilter=Options des filtres de recherche SearchFilter=Options des filtres de recherche
NumberOfKeyToSearch=Nb carac. déclenchant recherche: %s NumberOfKeyToSearch=Nb carac. déclenchant recherche: %s
ViewFullDateActions= Visualiser les dates des actions en entier dans la fiche tiers ViewFullDateActions= Visualiser les dates des actions en entier dans la fiche tiers

View File

@ -107,3 +107,5 @@ TypeContact_project_task_external_CONTRIBUTOR=Intervenant
DocumentModelBaleine=Modèle de rapport de projet complet (logo...) DocumentModelBaleine=Modèle de rapport de projet complet (logo...)
SelectElement=Eléments associable au projet : SelectElement=Eléments associable au projet :
AddElement=Associer AddElement=Associer
PlannedWorkload = Charge de travail prévue
WorkloadOccupation= Pourcentage affectation

View File

@ -41,6 +41,7 @@ class Task extends CommonObject
var $label; var $label;
var $description; var $description;
var $duration_effective; var $duration_effective;
var $planned_workload;
var $date_c; var $date_c;
var $date_start; var $date_start;
var $date_end; var $date_end;
@ -101,6 +102,7 @@ class Task extends CommonObject
$sql.= ", fk_user_creat"; $sql.= ", fk_user_creat";
$sql.= ", dateo"; $sql.= ", dateo";
$sql.= ", datee"; $sql.= ", datee";
$sql.= ", planned_workload";
$sql.= ", progress"; $sql.= ", progress";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= $this->fk_project; $sql.= $this->fk_project;
@ -111,6 +113,7 @@ class Task extends CommonObject
$sql.= ", ".$user->id; $sql.= ", ".$user->id;
$sql.= ", ".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null'); $sql.= ", ".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null');
$sql.= ", ".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null'); $sql.= ", ".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null');
$sql.= ", ".($this->planned_workload!=''?$this->planned_workload:0);
$sql.= ", ".($this->progress!=''?$this->progress:0); $sql.= ", ".($this->progress!=''?$this->progress:0);
$sql.= ")"; $sql.= ")";
@ -183,6 +186,7 @@ class Task extends CommonObject
$sql.= " t.label,"; $sql.= " t.label,";
$sql.= " t.description,"; $sql.= " t.description,";
$sql.= " t.duration_effective,"; $sql.= " t.duration_effective,";
$sql.= " t.planned_workload,";
$sql.= " t.datec,"; $sql.= " t.datec,";
$sql.= " t.dateo,"; $sql.= " t.dateo,";
$sql.= " t.datee,"; $sql.= " t.datee,";
@ -211,6 +215,7 @@ class Task extends CommonObject
$this->label = $obj->label; $this->label = $obj->label;
$this->description = $obj->description; $this->description = $obj->description;
$this->duration_effective = $obj->duration_effective; $this->duration_effective = $obj->duration_effective;
$this->planned_workload = $obj->planned_workload;
$this->date_c = $this->db->jdate($obj->datec); $this->date_c = $this->db->jdate($obj->datec);
$this->date_start = $this->db->jdate($obj->dateo); $this->date_start = $this->db->jdate($obj->dateo);
$this->date_end = $this->db->jdate($obj->datee); $this->date_end = $this->db->jdate($obj->datee);
@ -254,6 +259,7 @@ class Task extends CommonObject
if (isset($this->label)) $this->label=trim($this->label); if (isset($this->label)) $this->label=trim($this->label);
if (isset($this->description)) $this->description=trim($this->description); if (isset($this->description)) $this->description=trim($this->description);
if (isset($this->duration_effective)) $this->duration_effective=trim($this->duration_effective); if (isset($this->duration_effective)) $this->duration_effective=trim($this->duration_effective);
if (isset($this->planned_workload)) $this->planned_workload=trim($this->planned_workload);
// Check parameters // Check parameters
// Put here code to add control on parameters values // Put here code to add control on parameters values
@ -265,6 +271,7 @@ class Task extends CommonObject
$sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
$sql.= " duration_effective=".(isset($this->duration_effective)?$this->duration_effective:"null").","; $sql.= " duration_effective=".(isset($this->duration_effective)?$this->duration_effective:"null").",";
$sql.= " planned_workload=".(isset($this->planned_workload)?$this->planned_workload:"0").",";
$sql.= " dateo=".($this->date_start!=''?$this->db->idate($this->date_start):'null').","; $sql.= " dateo=".($this->date_start!=''?$this->db->idate($this->date_start):'null').",";
$sql.= " datee=".($this->date_end!=''?$this->db->idate($this->date_end):'null').","; $sql.= " datee=".($this->date_end!=''?$this->db->idate($this->date_end):'null').",";
$sql.= " progress=".$this->progress; $sql.= " progress=".$this->progress;
@ -524,7 +531,7 @@ class Task extends CommonObject
// List of tasks (does not care about permissions. Filtering will be done later) // List of tasks (does not care about permissions. Filtering will be done later)
$sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public,"; $sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public,";
$sql.= " t.rowid as taskid, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress,"; $sql.= " t.rowid as taskid, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress,";
$sql.= " t.dateo as date_start, t.datee as date_end"; $sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload";
if ($mode == 0) if ($mode == 0)
{ {
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
@ -586,6 +593,7 @@ class Task extends CommonObject
$tasks[$i]->description = $obj->description; $tasks[$i]->description = $obj->description;
$tasks[$i]->fk_parent = $obj->fk_task_parent; $tasks[$i]->fk_parent = $obj->fk_task_parent;
$tasks[$i]->duration = $obj->duration_effective; $tasks[$i]->duration = $obj->duration_effective;
$tasks[$i]->planned_workload= $obj->planned_workload;
$tasks[$i]->progress = $obj->progress; $tasks[$i]->progress = $obj->progress;
$tasks[$i]->public = $obj->public; $tasks[$i]->public = $obj->public;
$tasks[$i]->date_start = $this->db->jdate($obj->date_start); $tasks[$i]->date_start = $this->db->jdate($obj->date_start);
@ -997,6 +1005,7 @@ class Task extends CommonObject
$clone_task->fk_project = $project_id; $clone_task->fk_project = $project_id;
$clone_task->fk_task_parent = $parent_task_id; $clone_task->fk_task_parent = $parent_task_id;
$clone_task->date_c = $datec; $clone_task->date_c = $datec;
$clone_task->planned_workload = $clone_task->planned_workload;
//Manage Task Date //Manage Task Date
if ($clone_change_dt) if ($clone_change_dt)

View File

@ -132,10 +132,84 @@ else
} }
print "</table>"; print "</table>";
print '</td></tr></table>';
print '</div></div></div>'; print '</div></div></div>';
print '<div class="fichecenter">';
print '<BR>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
print '<th>'.$langs->trans('Projects').'</th>';
print '<th>'.$langs->trans('Task').'</th>';
print '<th>'.$langs->trans('DateStart').'</th>';
print '<th>'.$langs->trans('DateEnd').'</th>';
print '<th>'.$langs->trans('WorkloadOccupation').'</th>';
print '</tr>';
$sql = "SELECT p.title, p.rowid as projectid, t.label, t.rowid as taskid, u.rowid as userid, t.planned_workload, t.dateo, t.datee, tasktime.task_duration";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
$sql.= " WHERE p.entity = ".$conf->entity;
if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
$sql.= " AND p.fk_statut=1";
$sql.= " ORDER BY u.rowid, t.dateo, t.datee";
$userstatic=new User($db);
dol_syslog('projet:index.php: affectationpercent sql='.$sql,LOG_DEBUG);
$resql = $db->query($sql);
if ( $resql )
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
$username='';
$userstatic->fetch($obj->userid);
if (!empty($userstatic->id)) {
$username = $userstatic->getNomUrl(0,0);
}
print "<tr $bc[$var]>";
print '<td>'.$username.'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/projet/fiche.php?id="'.$obj->projectid.'">'.$obj->title.'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$obj->taskid.'&withproject=1">'.$obj->label.'</a></td>';
print '<td>'.dol_print_date($db->jdate($obj->dateo)).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datee)).'</td>';
if (empty($obj->planned_workload)) {
$percentcompletion = '0';
} else {
$percentcompletion = intval(($obj->task_duration*100)/$obj->planned_workload);
}
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">'.$percentcompletion.' %</a></td>';
print "</tr>\n";
$i++;
}
$db->free($resql);
}
else
{
dol_print_error($db);
}
print "</table></div>";
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -71,6 +71,7 @@ $hookmanager->initHooks(array('projecttaskcard'));
$progress=GETPOST('progress', 'int'); $progress=GETPOST('progress', 'int');
$label=GETPOST('label', 'alpha'); $label=GETPOST('label', 'alpha');
$description=GETPOST('description'); $description=GETPOST('description');
$planned_workload=GETPOST('planned_workloadhour');
$userAccess=0; $userAccess=0;
@ -115,6 +116,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
$task->fk_project = $projectid; $task->fk_project = $projectid;
$task->label = $label; $task->label = $label;
$task->description = $description; $task->description = $description;
$task->planned_workload = $planned_workload * 3600;//We set the planned workload into seconds
$task->fk_task_parent = $task_parent; $task->fk_task_parent = $task_parent;
$task->date_c = dol_now(); $task->date_c = dol_now();
$task->date_start = $date_start; $task->date_start = $date_start;
@ -292,6 +294,11 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie
print $form->select_date(($date_end?$date_end:-1),'datee',0,0,0,'',1,1); print $form->select_date(($date_end?$date_end:-1),'datee',0,0,0,'',1,1);
print '</td></tr>'; print '</td></tr>';
// planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
print $form->select_duration('planned_workload',$object->planned_workload,0,'text');
print '</td></tr>';
// Progress // Progress
print '<tr><td>'.$langs->trans("Progress").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Progress").'</td><td colspan="3">';
print $formother->select_percent($progress,'progress'); print $formother->select_percent($progress,'progress');
@ -391,6 +398,7 @@ else
print '<td>'.$langs->trans("LabelTask").'</td>'; print '<td>'.$langs->trans("LabelTask").'</td>';
print '<td align="center">'.$langs->trans("DateStart").'</td>'; print '<td align="center">'.$langs->trans("DateStart").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>'; print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="center">'.$langs->trans("PlannedWorkload").'</td>';
print '<td align="right">'.$langs->trans("Progress").'</td>'; print '<td align="right">'.$langs->trans("Progress").'</td>';
print '<td align="right">'.$langs->trans("TimeSpent").'</td>'; print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';

View File

@ -100,6 +100,7 @@ print '<td width="80">'.$langs->trans("RefTask").'</td>';
print '<td>'.$langs->trans("LabelTask").'</td>'; print '<td>'.$langs->trans("LabelTask").'</td>';
print '<td align="center">'.$langs->trans("DateStart").'</td>'; print '<td align="center">'.$langs->trans("DateStart").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>'; print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="center">'.$langs->trans("PlannedWorkload").'</td>';
print '<td align="right">'.$langs->trans("Progress").'</td>'; print '<td align="right">'.$langs->trans("Progress").'</td>';
print '<td align="right">'.$langs->trans("TimeSpent").'</td>'; print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -108,7 +109,7 @@ print '<tr class="liste_titre">';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_project" value="'.$search_project.'" size="8">'; print '<input type="text" class="flat" name="search_project" value="'.$search_project.'" size="8">';
print '</td>'; print '</td>';
print '<td class="liste_titre" colspan="5">'; print '<td class="liste_titre" colspan="6">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';

View File

@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$ref=GETPOST('ref','alpha'); $ref=GETPOST('ref','alpha');
@ -36,6 +37,7 @@ $action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha'); $confirm=GETPOST('confirm','alpha');
$withproject=GETPOST('withproject','int'); $withproject=GETPOST('withproject','int');
$project_ref=GETPOST('project_ref','alpha'); $project_ref=GETPOST('project_ref','alpha');
$planned_workload=GETPOST('planned_workloadhour');
// Security check // Security check
$socid=0; $socid=0;
@ -75,6 +77,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
$object->label = $_POST["label"]; $object->label = $_POST["label"];
$object->description = $_POST['description']; $object->description = $_POST['description'];
$object->fk_task_parent = $task_parent; $object->fk_task_parent = $task_parent;
$object->planned_workload = $planned_workload*3600; //We set the planned workload into seconds
$object->date_start = dol_mktime(0,0,0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']); $object->date_start = dol_mktime(0,0,0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']);
$object->date_end = dol_mktime(0,0,0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']); $object->date_end = dol_mktime(0,0,0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']);
$object->progress = $_POST['progress']; $object->progress = $_POST['progress'];
@ -283,6 +286,11 @@ if ($id > 0 || ! empty($ref))
print $form->select_date($object->date_end?$object->date_end:-1,'datee'); print $form->select_date($object->date_end?$object->date_end:-1,'datee');
print '</td></tr>'; print '</td></tr>';
// workload planned
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
print $form->select_duration('planned_workload',$object->planned_workload,0,'text');
print '</td></tr>';
// Progress // Progress
print '<tr><td>'.$langs->trans("Progress").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Progress").'</td><td colspan="3">';
print $formother->select_percent($object->progress,'progress'); print $formother->select_percent($object->progress,'progress');
@ -368,6 +376,11 @@ if ($id > 0 || ! empty($ref))
print dol_print_date($object->date_end,'day'); print dol_print_date($object->date_end,'day');
print '</td></tr>'; print '</td></tr>';
// planned Workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">';
print convertSecondToTime($object->planned_workload,'all');
print '</td></tr>';
// Progress // Progress
print '<tr><td>'.$langs->trans("Progress").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Progress").'</td><td colspan="3">';
print $object->progress.' %'; print $object->progress.' %';

View File

@ -56,7 +56,9 @@ if ($action == 'addtimespent' && $user->rights->projet->creer)
{ {
$error=0; $error=0;
if (empty($_POST["timespent_durationhour"]) && empty($_POST["timespent_durationmin"])) $timespent_durationhour = GETPOST('timespent_durationhour','int');
$timespent_durationmin = GETPOST('timespent_durationmin','int');
if (empty($timespent_durationhour) && empty($timespent_durationmin))
{ {
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Duration")).'</div>'; $mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Duration")).'</div>';
$error++; $error++;
@ -264,6 +266,9 @@ if ($id > 0 || ! empty($ref))
// Label // Label
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
// planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'all').'</td></tr>';
// Project // Project
if (empty($withproject)) if (empty($withproject))
{ {
@ -328,7 +333,7 @@ if ($id > 0 || ! empty($ref))
// Duration // Duration
print '<td class="nowrap" align="right">'; print '<td class="nowrap" align="right">';
print $form->select_duration('timespent_duration',($_POST['timespent_duration']?$_POST['timespent_duration']:'')); print $form->select_duration('timespent_duration',($_POST['timespent_duration']?$_POST['timespent_duration']:''),0,'text');
print '</td>'; print '</td>';
print '<td align="center">'; print '<td align="center">';
@ -435,7 +440,7 @@ if ($id > 0 || ! empty($ref))
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
{ {
print '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">'; print '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
print $form->select_duration('new_duration',$task_time->task_duration); print $form->select_duration('new_duration',$task_time->task_duration,0,'text');
} }
else else
{ {

View File

@ -245,6 +245,22 @@ if ($action == 'setprofidinvoicemandatory')
} }
} }
//Set hide closed customer into combox or select
if ($action == 'sethideinactivethirdparty')
{
$status = GETPOST('status','alpha');
if (dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX",$status,'chaine',0,'',$conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
/* /*
* View * View
*/ */
@ -728,6 +744,27 @@ else
print "</td>"; print "</td>";
} }
print '</tr>'; print '</tr>';
/*
// COMPANY_USE_SEARCH_TO_SELECT
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="80%">'.$langs->trans("HideClosedThirdpartyComboBox").'</td>';
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX))
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=sethideinactivethirdparty&status=0">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=sethideinactivethirdparty&status=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
}
print '</tr>';
*/
print '</table>'; print '</table>';