diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index d639230564bf3216d9d38170eaa5ba01c45aabfc..bbb03bafde55b90931662ee7e5ab52f5518722aa 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -337,7 +337,7 @@ p.titre { /* -------------- Boutons --------------------- */ .bouton_ajout_article { margin-top: 10px; - width: 100%; + width: 60%; height: 40px; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 78f12335f3638d73e05d0edaad4379ff976a6611..a1a1d1cc69ae3ddc90a04f80ed6eaf2981782bee 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -706,6 +706,11 @@ if (empty($reshook)) $result = $object->validate($user); } + else if ($action == 'reopen' && $user->rights->contrat->creer) + { + $result = $object->reopen($user); + } + // Close all lines else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) { @@ -1916,7 +1921,12 @@ else if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a></div>'; else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a></div>'; } - + if ($object->statut == 1 && $nbofservices) + { + if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Modify").'</a></div>'; + else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Modify").'</a></div>'; + } + if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { $langs->load("bills"); @@ -1976,6 +1986,12 @@ else print '</div><div class="fichehalfright"><div class="ficheaddleft">'; + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, 'contract', $socid); + + print '</div></div></div>'; } } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 905c9fa08a2dc0bdfe50bcdabea682000470e5ea..9e8b1de5d07acf3b3ffb50c32f1d1a07a9589100 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -472,7 +472,71 @@ class Contrat extends CommonObject } + /** + * Unvalidate a contract + * + * @param User $user Objet User + * @param int $notrigger 1=Does not execute triggers, 0=execute triggers + * @return int <0 if KO, >0 if OK + */ + function reopen($user, $notrigger=0) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + global $langs, $conf; + + $now=dol_now(); + + $error=0; + dol_syslog(get_class($this).'::reopen user='.$user->id); + $this->db->begin(); + + $this->fetch_thirdparty(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET statut = 0"; + //$sql.= ", fk_user_valid = null, date_valid = null"; + $sql .= " WHERE rowid = ".$this->id . " AND statut = 1"; + + dol_syslog(get_class($this)."::validate", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) + { + dol_print_error($this->db); + $error++; + $this->error=$this->db->lasterror(); + } + + // Trigger calls + if (! $error && ! $notrigger) + { + // Call trigger + $result=$this->call_trigger('CONTRACT_REOPEN',$user); + if ($result < 0) { + $error++; + } + // End call triggers + } + + // Set new ref and define current statut + if (! $error) + { + $this->statut=0; + $this->brouillon=1; + $this->date_validation=$now; + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + /** * Load a contract from database * diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index c177eb7965c2fd56a78205779614d82bb6043a5a..147850223cfed3e3ea83248b55c36a00d3ba3113 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -153,6 +153,7 @@ class Fichinter extends CommonObject $sql.= ", ".$conf->entity; $sql.= ", ".$user->id; $sql.= ", ".$user->id; + $sql.= ", ".$user->id; $sql.= ", ".($this->description?"'".$this->db->escape($this->description)."'":"null"); $sql.= ", '".$this->db->escape($this->modelpdf)."'"; $sql.= ", ".($this->fk_project ? $this->fk_project : 0); diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 97f19aebdab1cce1bc5269407f8591f14aa145be..1300963c2a8c511f6f5339430f44e02faeab78b3 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -168,6 +168,7 @@ ProjectsWithThisUserAsContact=Projects with this user as contact TasksWithThisUserAsContact=Tasks assigned to this user ResourceNotAssignedToProject=Not assigned to project ResourceNotAssignedToTask=Not assigned to task +ResourceNotAssignedToTheTask=Not assigned to the task AssignTaskToMe=Assign task to me AssignTask=Assign ProjectOverview=Overview diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index ddcae06838186ff47d335f71e5a828ba21e878db..7e23fe123d0d6f8d3a29896c336d754986de3b50 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -110,6 +110,35 @@ if ($action == 'addtime' && GETPOST('assigntask')) { $idfortaskuser=$user->id; $result = $object->add_contact($idfortaskuser, GETPOST("type"), 'internal'); + + if ($result >= 0 || $result == -2) // Contact add ok or already contact of task + { + // Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project) + $sql='SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact'; + $sql.=' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'"; + $resql=$db->query($sql); + if ($resql) + { + $obj=$db->fetch_object($resql); + if (! $obj) // User is not already linked to project, so we will create link to first type + { + $project = new Project($db); + $project->fetch($object->fk_project); + // Get type + $listofprojcontact=$project->liste_type_contact('internal'); + + if (count($listofprojcontact)) + { + $typeforprojectcontact=reset(array_keys($listofprojcontact)); + $result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal'); + } + } + } + else + { + dol_print_error($db); + } + } } if ($result < 0) diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 13bfa00163085ebf1e3efc51881abb12f6adf6ed..57da487aee0f84455df43fc04cd5e6b8e7646114 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -122,7 +122,36 @@ if ($action == 'addtime' && GETPOST('assigntask')) if (! $error) { $idfortaskuser=$user->id; - $result = $object->add_contact($idfortaskuser, GETPOST("type"), 'internal'); + $result = $object->add_contact($idfortaskuser, GETPOST("type"), 'internal'); + + if (! $result || $result == -2) // Contact add ok or already contact of task + { + // Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project) + $sql='SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact'; + $sql.=' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'"; + $resql=$db->query($sql); + if ($resql) + { + $obj=$db->fetch_object($resql); + if (! $obj) // User is not already linked to project, so we will create link to first type + { + $project = new Project($db); + $project->fetch($object->fk_project); + // Get type + $listofprojcontact=$project->liste_type_contact('internal'); + + if (count($listofprojcontact)) + { + $typeforprojectcontact=reset(array_keys($listofprojcontact)); + $result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal'); + } + } + } + else + { + dol_print_error($db); + } + } } if ($result < 0) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index ac0adf33c772cdf6838c94798f71a9f2368a28e9..5ed3655615e95796acf44ce1fd6fe110d90b2204 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -395,7 +395,7 @@ if ($id > 0 || ! empty($ref)) if (count($contactsoftask)>0) { $userid=$contactsoftask[0]; - print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTask")); + print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTheTask")); } else { @@ -405,7 +405,7 @@ if ($id > 0 || ! empty($ref)) // Note print '<td class="nowrap">'; - print '<textarea name="timespent_note" cols="80" rows="'.ROWS_2.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>'; + print '<textarea name="timespent_note" width="95%" rows="'.ROWS_2.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>'; print '</td>'; // Progress declared @@ -528,7 +528,7 @@ if ($id > 0 || ! empty($ref)) print '<td align="left">'; if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print '<textarea name="timespent_note_line" cols="80" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>'; + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>'; } else { diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ccb3f01d293d7717d1616ed8f73c8a037f8b9a63..30f97b557d407e54ce8a16af3f8d98faeb77961a 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1195,7 +1195,7 @@ div.vmenu, td.vmenu { .searchform { padding-top: 4px; } a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; } -font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; } +font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; } a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; } a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } @@ -2233,6 +2233,10 @@ div.pagination li.litext a:hover { background-color: transparent; background-image: none; } +div.pagination li.litext a:hover { + background-color: transparent; + background-image: none; +} <?php if (! empty($conf->dol_use_jmobile)) { ?> div.pagination li.litext { padding-top: 13px; diff --git a/htdocs/theme/md/img/object_billa.png b/htdocs/theme/md/img/object_billa.png index 19d4be8371db14278febf70be41acb3963dd7d0f..1485aea5aef4ce0989882853204133a9507accb7 100644 Binary files a/htdocs/theme/md/img/object_billa.png and b/htdocs/theme/md/img/object_billa.png differ diff --git a/htdocs/theme/md/img/object_billd.png b/htdocs/theme/md/img/object_billd.png index 19d4be8371db14278febf70be41acb3963dd7d0f..93b0e55d04628435bbe6a5459ac26e2a1ee0e416 100644 Binary files a/htdocs/theme/md/img/object_billd.png and b/htdocs/theme/md/img/object_billd.png differ diff --git a/htdocs/theme/md/img/object_billr.png b/htdocs/theme/md/img/object_billr.png index 19d4be8371db14278febf70be41acb3963dd7d0f..e921b9d9f1fda76d3bf9c3081e3957cfebf38038 100644 Binary files a/htdocs/theme/md/img/object_billr.png and b/htdocs/theme/md/img/object_billr.png differ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 782eb0d66a24a0456f862c521d1eb6cddb1579d9..02896756c64a6ee12b3a703dd52027efa0402d94 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1231,11 +1231,11 @@ div.vmenu, td.vmenu { .searchform { padding-top: 8px; } a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; } -font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #93a5aa; } +font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; } a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; } a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } -font.vsmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #93a5aa; } +font.vsmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #aaa; } a.vsmenu:link, a.vsmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; } font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }