diff --git a/admin/setup.php b/admin/setup.php index c7ff591..5b91440 100644 --- a/admin/setup.php +++ b/admin/setup.php @@ -42,6 +42,7 @@ // Libraries require_once __DIR__ . '/../class/digikanban.class.php'; require_once __DIR__ . '/../lib/digikanban.lib.php'; +require_once __DIR__ . '/../lib/digikanban_functions.lib.php'; // Global variables definitions global $conf, $db, $langs, $moduleName, $user; diff --git a/check.php b/check.php index 7bf678e..a6b4a11 100644 --- a/check.php +++ b/check.php @@ -19,6 +19,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once __DIR__ . '/lib/digikanban_functions.lib.php'; + dol_include_once('/digikanban/class/digikanban_checklist.class.php'); dol_include_once('/digikanban/class/digikanban.class.php'); dol_include_once('/digikanban/class/digikanban_tags.class.php'); @@ -871,13 +873,13 @@ $updatetask = false; $option_taskurgent = !empty($task->array_options['options_digikanban_taskurgent']) ? $task->array_options['options_digikanban_taskurgent'] : ''; $keytag = !empty($task->array_options['options_digikanban_colomn']) ? $task->array_options['options_digikanban_colomn'] : ''; - checkIfNeedToBeTransfered($task, $updatetask, $tobetransferedto, $option_taskurgent); + check_if_need_to_be_transfered($task, $updatetask, $tobetransferedto, $option_taskurgent); $key = $keytag>0 ? $keytag : 1; // if(!$obj->dateo || !$obj->datee){ - // $html = getTaskelement($obj, $task, $kanban->status_date, 'enattent'); + // $html = get_task_element($obj, $task, $kanban->status_date, 'enattent'); // $data['enattent'][]=$html; // } @@ -888,7 +890,7 @@ // $updatetask = 1; // } - // $html = getTaskelement($obj, $task, $kanban->status_date, 'urgents'); + // $html = get_task_element($obj, $task, $kanban->status_date, 'urgents'); // $data['urgents'][] = $html; // } @@ -897,7 +899,7 @@ // $dd = dol_getdate($db->jdate($obj->dateo)); // $dt = dol_mktime(0, 0, 0, $dd['mon'], 1, $dd['year']); - // $html = getTaskelement($obj, $task, $kanban->status_date); + // $html = get_task_element($obj, $task, $kanban->status_date); // $data['month'.$dt][]=$html; // } @@ -909,7 +911,7 @@ // } // if($task->array_options['options_digikanban_colomn']>0 || $object->showtaskinfirstcolomn>0){ - $html = getTaskelement($obj, $task, $kanban->status_date, 'urgents'); + $html = get_task_element($obj, $task, $kanban->status_date, 'urgents'); $data['colomn'.$key][]=$html; // } @@ -1056,7 +1058,7 @@ // $tobetransferedto = 0; // $updatetask = false; - // checkIfNeedToBeTransfered($task, $updatetask, $tobetransferedto, $option_taskurgent = 0); + // check_if_need_to_be_transfered($task, $updatetask, $tobetransferedto, $option_taskurgent = 0); // if ($tobetransferedto == 1) { // $result['error'] = 1; @@ -1115,7 +1117,7 @@ } - $titletask = kanbanGetTitleOfCurrentTask($task); + $titletask = kanban_get_title_of_current_task($task); $result['titletask'] = $titletask; // $html = "true"; @@ -1158,7 +1160,7 @@ $html .= ''; $html .= $checklist->selectCheck($id_tache); }elseif($id_modal){ - $html .= selectCheckModal($id_modal); + $html .= select_check_modal($id_modal); } $html .= '
'; diff --git a/columns/card.php b/columns/card.php index c1f8fc5..0491070 100644 --- a/columns/card.php +++ b/columns/card.php @@ -12,6 +12,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; dol_include_once('/digikanban/lib/digikanban.lib.php'); +dol_include_once('/digikanban/lib/digikanban_functions.lib.php'); dol_include_once('/digikanban/class/digikanban.class.php'); dol_include_once('/digikanban/class/digikanban_columns.class.php'); @@ -148,7 +149,7 @@ llxHeader(array(), $modname,'','','','',$morejs,0,0); $linkback =""; -digikanbanPrepareAdminHead('columns', $linkback, 'title_setup'); +digikanban_admin_prepare_head('columns', $linkback, 'title_setup'); $htmlright = ""; diff --git a/columns/list.php b/columns/list.php index bc077ca..77e59b9 100644 --- a/columns/list.php +++ b/columns/list.php @@ -14,6 +14,7 @@ dol_include_once('/digikanban/class/digikanban.class.php'); dol_include_once('/digikanban/class/digikanban_columns.class.php'); dol_include_once('/digikanban/lib/digikanban.lib.php'); +dol_include_once('/digikanban/lib/digikanban_functions.lib.php'); if (empty($conf->digikanban->enabled) || !$user->rights->digikanban->lire) accessforbidden(); @@ -231,7 +232,7 @@ llxHeader('', $title, $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs); $linkback =""; -digikanbanPrepareAdminHead('columns', $linkback, 'title_setup'); +digikanban_admin_prepare_head('columns', $linkback, 'title_setup'); $sql = "SELECT"; diff --git a/index.php b/index.php index 1bb4b1f..b4024e8 100644 --- a/index.php +++ b/index.php @@ -13,6 +13,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; dol_include_once('/digikanban/class/digikanban.class.php'); dol_include_once('/digikanban/lib/digikanban.lib.php'); +dol_include_once('/digikanban/lib/digikanban_functions.lib.php'); dol_include_once('/digikanban/class/taches/elements_contacts.class.php'); dol_include_once('/digikanban/class/digikanban_tags.class.php'); dol_include_once('/digikanban/class/digikanban_columns.class.php'); @@ -605,7 +606,7 @@ print ''; // print $langs->trans("Projects").': '; - print ''; + print ''; print img_picto($langs->trans('SortOrder'), 'setup', ' class="linkobject"'); print ''; // print img_picto($langs->trans('Projects'), 'project', ''); @@ -710,7 +711,7 @@ print ''; if(isset($conf->ganttproadvanced) && $conf->ganttproadvanced->enabled){ - $head = digikanbanTasksAdminPrepareHead($tosendingantt); + $head = digikanban_tasks_admin_prepare_head($tosendingantt); dol_fiche_head($head, 'kanban', '', -1, ''); } diff --git a/langs/fr_FR/digikanban.lang b/langs/fr_FR/digikanban.lang index 5d32799..bf3a8ff 100644 --- a/langs/fr_FR/digikanban.lang +++ b/langs/fr_FR/digikanban.lang @@ -1,95 +1,103 @@ -digikanban=Digikanban -Module19055200Desc=Digikanban -enattentkanban=En Attente -urgentskanban=Urgences -Addtask=Ajouter une tâche -writecomment=Écrivez un commentaire… - -list_columns=Liste des colonnes digikanban -Colomndigikanban=Colonne digikanban - -EnAttent=En Attente -ALivrer=A Livrer -EnCours=En Cours -Chronique=Chronique -Cloturer=Clôturés - -tagsdigikanban=Tags Digikanban - -COMMENT_TASK_CREATE=Commentaire créée -COMMENT_TASK_MODIFY=Commentaire modifiée -COMMENT_TASK_DELETE=Commentaire supprimée -COMMENT_TASK_ECHECK_CREATE=Commentaire échoué -COMMENT_TASK_ECHECK_DELETE=Suppréssion échoué -COMMENT_TASK_ECHECK_UPDATE=Modification échoué - -nbrelements=Nombre d'éléments : -alert_depasse_dure=Vous avez dépassé la charge de travail prévue -cloner_task=Cloner tâche -color_datejalon=Statut date jalon -changestatusdate=Changer statut de date jalon -ganttproadvanceddatejalon=Date Jalon -grey=Gris -green=Vert -red=Rouge -config_vue_kanban=Configuration du module digikanban Tâches Plus -contact_tache=Contacts de la tâche -type_contact_tache=Type de contact (tâche) principal -ViewTask=Voir la tâche -viewgantt=Vue Gantt -viewkanban=Vue Kanban -TaskUrgent=Tâche urgente -DELEY_ALERTE_DATEJALON=Délai d'alerte de date Jalon -DaylyHours=Heures de travail par jour - -SelectedHoursLessThanPlannedWorkload=Les heures de travail sélectionné sont inférieures à la charge de travail prévu - -JalonDate=Date jalon -showallprojets=Sélectionner par défaut tous les projet - -ShowAll=Afficher tout -HideAll=Cacher tout -SelectAll=Tout sélectionner -addtags=Créer une nouvelle étiquette -SearchByContactType=Recherche par type de contact -NewTag=Nouvelle étiquette -Comments=Commentaires -checklisttask=CheckList -Update_checklisttask=Modifier CheckList de tâche -Update_checklistmodal=Modifier CheckList du modèle -EtiquettesModal=Modifier les étiquettes du modèle -createtag=Créer une nouvelle étiquette -createcheck=Ajouter un élément -totalcoutstemp=Coût temps consommé -Le=Le - -NumTask=Numéro de tâche -NumProjet=Numéro de projet -Modele=Modèle -CreateModel=Créer un modèle -UseTemplate=Utiliser ce modèle -EditEtiquettes=Modifier les étiquettes -EditChecklist=Modifier check-list -titlemodal=Titre du modèle - -ModelsManagement=Gestion des modèles -digikanbanmsgconfiraction=Êtes-vous sûr de vouloir continuer ? - -newcolomn=Ajouter un colonne -printcolomntitle=Saisissez le titre de la liste… -hidetaskisprogress100=Cacher par défaut les tâches qui ont déjà été réalisé (Progress %s) -progressless100=Cacher tâches achevées -ModifyColomn=Modifier le titre de colonne -columns=Gestion des colonnes -infoprogress100=Tâches avec un avancement de %s -msg_confirm=Êtes-vous sûr de vouloir continuer la suppression ? - -FieldsToShowWhenModifyingATask=Champs à afficher lors de la modification du tâche -FieldsToShowWhenHoveringATask=Champs à afficher lors du survol du tâche - -showtaskinfirstcolomn=Afficher les tâches qui n'ont pas de statut dans la première colonne -OtherContact=Autres contributeurs -MaximumNumberOfContactsToDisplayNextToThePrimaryUser=Nombre maximum de contacts à afficher à côté de l'utilisateur principal +digikanban = Digikanban +Module19055200Desc = Digikanban +EnAttentKanban = En Attente +UrgentsKanban = Urgences +Addtask = Ajouter une tâche +WriteComment = Écrivez un commentaire… + +ListColumns = Liste des colonnes digikanban +ColomnDigikanban = Colonne digikanban + +EnAttent = En Attente +ALivrer = A Livrer +EnCours = En Cours +Chronique = Chronique +Cloturer = Clôturés + +TagsDigikanban = Tags Digikanban + +COMMENT_TASK_CREATE = Commentaire créée +COMMENT_TASK_MODIFY = Commentaire modifiée +COMMENT_TASK_DELETE = Commentaire supprimée +COMMENT_TASK_ECHECK_CREATE = Commentaire échoué +COMMENT_TASK_ECHECK_DELETE = Suppréssion échoué +COMMENT_TASK_ECHECK_UPDATE = Modification échoué + +NbrElements = Nombre d'éléments : +AlertDepasseDure = Vous avez dépassé la charge de travail prévue +ClonerTask = Cloner tâche +ColorDatejalon = Statut date jalon +ChangeStatusDate = Changer statut de date jalon +GanttProAdvancedDateJalon = Date Jalon +grey = Gris +green = Vert +red = Rouge +ConfigVueKanban = Configuration du module digikanban Tâches Plus +ContactTache = Contacts de la tâche +TypeContactTache = Type de contact (tâche) principal +ViewTask = Voir la tâche +ViewGantt = Vue Gantt +ViewKanban = Vue Kanban +TaskUrgent = Tâche urgente +DELEY_ALERTE_DATEJALON = Délai d'alerte de date Jalon +DaylyHours = Heures de travail par jour + +SelectedHoursLessThanPlannedWorkload = Les heures de travail sélectionné sont inférieures à la charge de travail prévu + +JalonDate = Date jalon +showallprojets = Sélectionner par défaut tous les projet + +ShowAll = Afficher tout +HideAll = Cacher tout +SelectAll = Tout sélectionner +AddTags = Créer une nouvelle étiquette +SearchByContactType = Recherche par type de contact +NewTag = Nouvelle étiquette +Comments = Commentaires +CheckListTask = CheckList +UpdateCheckListTask = Modifier CheckList de tâche +UpdateCheckListModal = Modifier CheckList du modèle +EtiquettesModal = Modifier les étiquettes du modèle +CreateTag = Créer une nouvelle étiquette +CreateCheck = Ajouter un élément +TotalCoutsTemp = Coût temps consommé +Le = Le + +NumTask = Numéro de tâche +NumProjet = Numéro de projet +Modele = Modèle +CreateModel = Créer un modèle +UseTemplate = Utiliser ce modèle +EditEtiquettes = Modifier les étiquettes +EditChecklist = Modifier check-list +titlemodal = Titre du modèle + +ModelsManagement = Gestion des modèles +DigikanbanMsgConfirAction = Êtes-vous sûr de vouloir continuer ? + +NewColomn = Ajouter un colonne +PrintColomnTitle = Saisissez le titre de la liste… +HideTaskIsProgress100 = Cacher par défaut les tâches qui ont déjà été réalisé (avancée %s) +ProgressLess100 = Cacher tâches achevées +ModifyColomn = Modifier le titre de colonne +Columns = Gestion des colonnes +InfoProgress100 = Tâches avec un avancement de %s +MsgConfirm = Êtes-vous sûr de vouloir continuer la suppression ? + +FieldsToShowWhenModifyingATask = Champs à afficher lors de la modification du tâche +FieldsToShowWhenHoveringATask = Champs à afficher lors du survol du tâche + +ShowTaskInFirstColomn = Afficher les tâches qui n'ont pas de statut dans la première colonne +OtherContact = Autres contributeurs +MaximumNumberOfContactsToDisplayNextToThePrimaryUser = Nombre maximum de contacts à afficher à côté de l'utilisateur principal +NumberOfUsers = Affiche le nombre d'utilisateurs sur la tâche +WarningDate = Détermine le délai d'alerte pour la date jalon +RefreshPage = Rafraîchit automatiqument la page +SelectProjects = Sélectionne un filtre sur tous les projets par défauts +HideTasks = Permet de cacher par défaut les tâches terminée +NoStatusTasks = Affiche les tâches n'ayant pas de statut dans la première colonne par défaut +ColomnDesc = Permet de choisir la colonne d'apparition de base pour les tâches ajoutées +DelayDesc = Délai d'alerte par défaut pour les dates jalon # # Config page - Page d'administration diff --git a/lib/digikanban.lib.php b/lib/digikanban.lib.php index 44a803d..6b9af1f 100644 --- a/lib/digikanban.lib.php +++ b/lib/digikanban.lib.php @@ -1,858 +1,45 @@ load("digikanban@digikanban"); - - $h = 0; - $head = array(); - - if($conf->ganttproadvanced->enabled){ - $head[$h][0] = dol_buildpath("/ganttproadvanced/index.php?mode=gantt".$tosendinurl, 1); - $head[$h][1] = $langs->trans("viewgantt"); - $head[$h][2] = 'gantt'; - $h++; - - $search_scale = GETPOST("scale", 'alpha'); - if($search_scale) { - $resusrs = dol_set_user_param($db, $conf, $user, ['GANTTPROADVANCED_DEFAULT_ZOOM_BY' => $search_scale]); - } - } - - - $head[$h][0] = dol_buildpath("/digikanban/index.php?mode=kanban".$tosendinurl, 1); - $head[$h][1] = $langs->trans("viewkanban"); - $head[$h][2] = 'kanban'; - $h++; - - return $head; -} - - - -function getTaskelement($object, $task, $status=[], $currentColomn='') -{ - global $db, $langs, $conf; - - require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - dol_include_once('/digikanban/class/digikanban_tags.class.php'); - dol_include_once('/digikanban/class/digikanban_checklist.class.php'); - dol_include_once('/digikanban/class/digikanban_commnts.class.php'); - - - $form = new Form($db); - $kanban = new digikanban($db); - $digikanban_tags = new digikanban_tags($db); - $checklist = new digikanban_checklist($db); - $getchecklist = new digikanban_checklist($db); - $kanbancommnts = new digikanban_commnts($db); - - - // $colorgantt = $conf->ganttproadvanced->enabled ? $ganttproadvanced->p_projectcolor : ''; - $colorgantt = ''; - $color = $object->color ? $object->color : ($colorgantt ? $colorgantt : '#00ffff'); - $clr=''; - $arr_color = colorStringToArray($color); - if($arr_color){ - foreach ($arr_color as $key => $value) { - $clr .= $value.', '; - } - } - $bgcolor = $clr ? 'rgb('.$clr.'0.3)' : $color; - $descrptask = ''; - $descrptask .= ''.$langs->trans('Description').': '; - $descrptask .= ''.$object->description.': '; - - $debutday = $task->date_start ? date('d', $task->date_start) : ''; - $debutmonth = $task->date_start ? date('m', $task->date_start) : ''; - $debutyear = $task->date_start ? date('Y', $task->date_start) : ''; - - $finday = $task->date_end ? date('d', $task->date_end) : ''; - $finmonth = $task->date_end ? date('m', $task->date_end) : ''; - $finyear = $task->date_end ? date('Y', $task->date_end) : ''; - - $dd = dol_getdate(dol_now()); - $now = dol_mktime(0, 0, 0, $dd['mon'], $dd['mday'], $dd['year']); - - $tags = $digikanban_tags->fetchAllTagsOfTask($task->id); - $checklist = $checklist->calcProgressCheckTask($task->id); - $html = '
'; - - - $html .= ''; - $html .= ''; - $html .= ''; - - - $html .= ''; - $html .= ''; - $html .= ''; - - $titletask = kanbanGetTitleOfCurrentTask($task); - - // $html .= '
'; - $html .= '
'; - - $titledescp ='
'; - $titledescp .= '
'; - $titledescp .= ''.$langs->trans("Description").': '; - $titledescp .= ''.$task->description.''; - $titledescp .= '
'; - $titledescp .= '
'; - - // $html .= ''; - // $html .= ''; - // $html .= ''; - // $html .= $task->ref; - // $html .= ''; - // $html .= ''; - // $html .= ''; - $html .= '
'; - $alltag = ''; - if($tags && count($tags)>0){ - $i=0; - $alltag=''; - $txt_tag=''; - $div_tag=''; - foreach ($tags as $key => $value) { - - $color = $value['color'] ? $value['color'] : '#00ffff'; - $clr=''; - $arr_color = colorStringToArray($color); - if($arr_color){ - foreach ($arr_color as $key1 => $value1) { - $clr .= $value1.', '; - } - } - $bgcolor = $clr ? 'rgb('.$clr.'0.3)' : $color; - if($i < 2){ - $html .= ''; - $html .= ''; - $html .= ''; - $html .= $value['label']; - $html .= ''; - $html .= ''; - }else{ - $txt_tag .= ''; - $txt_tag .= ''; - $txt_tag .= ''.$value['label'].''; - $txt_tag .= ''; - - } - - $i++; - - } - $div_tag .= '
'; - $div_tag .= $txt_tag; - $div_tag .= '
'; - if(count($tags)>2) - $alltag = '...'; - } - - $html .= $alltag; - $html .= '+'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= ''.img_edit().''; - $html .= '
'; - $html .= '
'; - - - $fields_hover_popup = $kanban->fields_hover_popup ? explode(',', $kanban->fields_hover_popup) : []; - $hover_popup = $fields_hover_popup ? array_flip($fields_hover_popup) : []; - - - // $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= img_picto('', $task->picto, 'class="pictofixedwidth"'); - - if (isset($hover_popup['Ref'])) { - $html .= $task->ref.($task->label ? ' - ' : ''); - } - $html .= ''; - $html .= $task->label; - $html .= ''; - $html .= '
'; - - - $html .= '
'; - $html .= img_picto('', 'project', 'class="pictofixedwidth"'); - $html .= ''; - if (isset($hover_popup['NumProjet'])) { - $html .= $object->ref_proj.($object->label_proj ? ' - ' : ''); - } - $html .= $object->label_proj; - $html .= ''; - $html .= '
'; - - $html .= '
'; - $html .= img_picto('', 'calendar', 'class="pictofixedwidth"'); - $html .= ''; - $html .= $task->date_start ? dol_print_date($task->date_start, 'dayhour') : ''; - $html .= $task->date_start && $task->date_end ? ' - ' : ''; - $html .= $task->date_end ? dol_print_date($task->date_end, 'dayhour') : ''; - $html .= ''; - $html .= '
'; - - $html .= '
'; - $html .= '
'; - - $date_jalon = (!empty($task->array_options['options_ganttproadvanceddatejalon']) ? $task->array_options['options_ganttproadvanceddatejalon'] : ''); - // $name_color = isset($task->array_options['options_color_datejalon']) ? $task->array_options['options_color_datejalon'] : ( ($date_jalon && $db->jdate($date_jalon) <= $now ) ? 'red' : $name_color); - $name_color = (!empty($task->array_options['options_color_datejalon']) ? $task->array_options['options_color_datejalon'] : 'grey'); - - if($currentColomn == 'enattent'){ - $name_color = (($date_jalon <= $now ) ? 'red' : $name_color); - } - - $color = $status[$name_color]; - if($date_jalon){ - $datejalontitle = $langs->trans("Progress").': '.($task->progress ? $task->progress : 0).' %'; - - $html .= ''; - $html .= ' '.dol_print_date($date_jalon, '%d %b'); - $html .= ''; - - $tobetransferedto = 0; - $updatetask = false; - checkIfNeedToBeTransfered($task, $updatetask, $tobetransferedto, $option_taskurgent = 0); - - $html .= ''; - if($tobetransferedto == 1) { - $html .= img_error($langs->trans('DELEY_ALERTE_DATEJALON')); - } else { - $html .= img_warning($langs->trans('urgentskanban')); - } - $html .= ''; - } - $html .= ' '; - if($task->description) { - $html .= ''; - } - $cl_check = $checklist['percent'] == 100 ? 'checklist100' : ''; - - - $hover_checklist = $getchecklist->selectCheck($task->id, 1); - $tmptitle = $hover_checklist ? 'title="'.dol_escape_htmltag($hover_checklist, 0, 1).'"' : ''; - - $html .= ''; - $html .=''; - $html .= $checklist['total'] ? ' '.$checklist['checked'].'/'.$checklist['total'].'' : ''; - $html .=''; - - $nbrcomm = $object->nb_comments ? '('.$object->nb_comments.')' : ''; - - $spntxtcmt = ''; - - $spntxtcmt .= ''; - if($object->nb_comments) { - $spntxtcmt .= ($object->nb_comments < 9) ? $object->nb_comments : '+9'; - } - $spntxtcmt .= ''; - - $hover_comments = $kanbancommnts->getcomments($task->id); - $tmptitlecmt = $hover_comments['htmlhover'] ? 'title="'.dol_escape_htmltag($hover_comments['htmlhover'], 0, 1).'"' : ''; - - $html .= ''.$spntxtcmt.''; - $html .= '
'; - - $maxnumbercontactstodisplay = $kanban->maxnumbercontactstodisplay; - - $html .= '
'; - - - ########################################################################################################################################## Contact Principal - $i = 0; - $affctedto = ''; - $tab = $task->liste_contact(-1, 'internal', 0, $kanban->t_typecontact); - $userstatic = new User($db); - if(isset($tab[$i]) && $tab[$i]['id']){ - $userstatic->id = $tab[$i]['id']; - $userstatic->lastname = $tab[$i]['lastname']; - $userstatic->firstname = $tab[$i]['firstname']; - $userstatic->email = $tab[$i]['email']; - $userstatic->photo = $tab[$i]['photo']; - $userstatic->statut = 1; - $affctedto_id = $userstatic->id; - $affctedto = $userstatic->getNomUrl(-2); - } - - ########################################################################################################################################## Contact Contributor - - $jscontact=''; - // $userstatics = new User($db); - - // $userstatics->id = $object->fk_user_creat; - // $userstatics->lastname = $object->lastname; - // $userstatics->firstname = $object->firstname; - // $userstatics->email = $object->email; - // $userstatics->photo = $object->photo; - // $userstatics->statut = 1; - - // $createur = $userstatics->getNomUrl(-2); - // // $html .= ' '.$form->showphoto('userphoto', $userstatic, 0, 0, 0, 'userphoto', 'mini', 0, 1).' '.dol_string_nohtmltag($userstatic->getFullName($langs, '')).''; - // $html .= ''.$createur.''; - - - if($maxnumbercontactstodisplay > 0) { - - $tab = $task->liste_contact(-1, 'internal', 0, 'TASKCONTRIBUTOR'); - $num = count($tab); - $i = 0; - $htmlcontact = ''; - - - if($num){ - while ($i < $num) { - - if(isset($tab[$i]) && $tab[$i]['id']) { - $userstatic = new User($db); - - if($affctedto_id != $tab[$i]['id'] || ($affctedto_id == $tab[$i]['id'] && $kanban->t_typecontact != 'TASKCONTRIBUTOR')){ - $userstatic->id = $tab[$i]['id']; - // $userstatic->login = $tab[$i]['login']; - $userstatic->lastname = $tab[$i]['lastname']; - $userstatic->firstname = $tab[$i]['firstname']; - $userstatic->email = $tab[$i]['email']; - $userstatic->photo = $tab[$i]['photo']; - $userstatic->statut = 1; - - if($i<$maxnumbercontactstodisplay){ - $htmlcontact .= ''.$userstatic->getNomUrl(-2).''; - }else{ - // $jscontact .= ' - '.$form->showphoto('userphoto', $us, 0, 0, 0, 'userphoto', 'mini', 0, 1).' '.dol_string_nohtmltag($us->getFullName($langs, '')).' '.$us->getLibStatut(4).'
'; - $jscontact .= ' - '.$form->showphoto('userphoto', $userstatic, 0, 0, 0, 'userphoto', 'mini', 0, 1).' '.dol_string_nohtmltag($userstatic->getFullName($langs, '')).'
'; - } - - } - - } - $i++; - } - if($jscontact) { - $jscontact = ''.$langs->trans('OtherContact').':
'.$jscontact; - $htmlcontact = '... '.$htmlcontact; - } - - $html .= $htmlcontact; - } - } - - - $html .= $affctedto ? ''.$affctedto.'' : ''; - - $html .= '
'; - $html .= '
'; - $html .= '
'; - - return $html; -} - -function kanbanGetTitleOfCurrentTask($task) { - - global $db, $langs, $conf; - - $kanban = new digikanban($db); - $extrafields = new ExtraFields($db); - $extrafields->fetch_name_optionals_label($task->table_element); - - $fields_hover_popup = $kanban->fields_hover_popup ? explode(',', $kanban->fields_hover_popup) : []; - - $hover_popup = $fields_hover_popup ? array_flip($fields_hover_popup) : []; - - - - $hiddenperiode = ($hover_popup && isset($hover_popup['Period'])) ? '' : 'digikanbanhidden'; - - $titletask = '
'; - $titletask .= '
'; - $titletask .= ''; - // $titletask .= ''.dol_print_date($task->date_start, "%d %B %Y"); - $titletask .= $task->date_start ? dol_print_date($task->date_start, "%d %B %Y") : '?'; - $titletask .= $task->date_end ? ' - '.dol_print_date($task->date_end, "%d %B %Y") : ' - ?'; - $titletask .= ''; - $titletask .= '
'; - - $hiddenlabel = ($hover_popup && isset($hover_popup['Label'])) ? '' : 'digikanbanhidden'; - - $titletask .= '
'; - // $titletask .= ''. img_picto('', $task->picto).' '.$task->ref.' - '.$task->label.'   '.dol_escape_js($langs->trans("Show")).''; - $titletask .= ''; - - $titletask .= img_picto('', $task->picto).' '; - - if (isset($hover_popup['Ref'])) { - $titletask .= $task->ref.(($task->label && isset($hover_popup['Label'])) ? ' - ' : ''); - - } - - $titletask .= $task->label; - $titletask .= ''; - - $titletask .= '
'; - - if($task->fk_task_parent){ - $taskparent = new Task($db); - $taskparent->fetch($task->fk_task_parent); - $titletask .= '
'; - $titletask .= ''.$langs->trans('ChildOfTask').': '.$taskparent->ref.' - '.$taskparent->label.' '; - // $titletask .= ''.dol_escape_js($langs->trans("Show")).''; - $titletask .= ''; - $titletask .= '
'; - } - - $duration=0; - if($task->date_start && $task->date_end){ - $_start = $task->date_start; - $_end = $task->date_end; - $datediff = $_end-$_start; - $duration = round($datediff / (60 * 60 * 24)); - } - - $hiddenduree = ($hover_popup && isset($hover_popup['Duration'])) ? '' : 'digikanbanhidden'; - - $titletask .= '
'; - $titletask .= ''.$langs->trans('Duration').': '.$duration.' '.strtolower($langs->trans("Days")).' '; - $titletask .= '
'; - - - $hiddenplannedwork = ($hover_popup && isset($hover_popup['PlannedWorkload'])) ? '' : 'digikanbanhidden'; - - $titletask .= '
'; - $planned_workload = ($task->planned_workload != '') ? convertSecondToTime($task->planned_workload, 'allhourmin') : '--:--'; - $titletask .= ''.$langs->trans('PlannedWorkload').': '.$planned_workload.' '; - $titletask .= '
'; - - - - $timespent = ($task->duration_effective) ? convertSecondToTime($task->duration_effective, 'allhourmin') : '--:--'; - $hiddentimespent = ($hover_popup && isset($hover_popup['TimeSpent'])) ? '' : 'digikanbanhidden'; - - $titletask .= '
'; - $titletask .= ''.$langs->trans("TimeSpent").': '.$timespent.''; - $titletask .= '
'; - - - $hiddenprogress = ($hover_popup && isset($hover_popup['ProgressDeclared'])) ? '' : 'digikanbanhidden'; - - $titletask .= '
'; - $titletask .= ''.$langs->trans("Progress").': '.($task->progress ? $task->progress.' %' : '').''; - $titletask .= '
'; - - $tab = $task->liste_contact(-1, 'internal', 0, $kanban->t_typecontact); - - $userstatic = new User($db); - - $affctedto=''; - $i = 0; - if(isset($tab[$i]) && $tab[$i]['id'] ){ - $userstatic->id = $tab[$i]['id']; - $userstatic->lastname = $tab[$i]['lastname']; - $userstatic->firstname = $tab[$i]['firstname']; - $userstatic->email = $tab[$i]['email']; - $userstatic->photo = $tab[$i]['photo']; - $userstatic->statut = 1; - $affctedto = $userstatic->getNomUrl(-1, 0); - } - - $hiddenaffectedt = ($hover_popup && isset($hover_popup['AffectedTo'])) ? '' : 'digikanbanhidden'; - $titletask .= '
'; - $titletask .= ''.$langs->trans("AffectedTo").': '.$affctedto.''; - $titletask .= '
'; - - - $hiddenjalondate = ($hover_popup && isset($hover_popup['JalonDate'])) ? '' : 'digikanbanhidden'; - - $titletask .= '
'; - $date_jalon = (!empty($task->array_options['options_ganttproadvanceddatejalon']) ? dol_print_date($task->array_options['options_ganttproadvanceddatejalon'], 'day') : ''); - $titletask .= ''.$langs->trans("ganttproadvanceddatejalon").': '.$date_jalon.''; - $titletask .= '
'; - - - - $hiddendescription = ($hover_popup && isset($hover_popup['Description'])) ? '' : 'digikanbanhidden'; - // if($task->description){ - $titletask .= '
'; - $titletask .= ''.$langs->trans("Description").': '.$task->description.''; - $titletask .= '
'; - // } - - $hiddenbudgets = ($hover_popup && isset($hover_popup['Budget'])) ? '' : 'digikanbanhidden'; - // if($task->budget_amount){ - $titletask .= '
'; - $titletask .= ''.$langs->trans("Budget").': '.price($task->budget_amount).''; - $titletask .= '
'; - // } - - $coutstemepconsomme = $kanban->coutstemepconsomme($task->id); - $hiddentotalcoutstemp = ($hover_popup && isset($hover_popup['totalcoutstemp'])) ? '' : 'digikanbanhidden'; - // if($coutstemepconsomme){ - $titletask .= '
'; - $titletask .= ''.$langs->trans("totalcoutstemp").': '.price($coutstemepconsomme).''; - $titletask .= '
'; - // } - - if($extrafields->attributes[$task->table_element]['label']){ - foreach ($extrafields->attributes[$task->table_element]['label'] as $key => $label) { - if(($extrafields->attributes[$task->table_element]['list'][$key] == 1 || $extrafields->attributes[$task->table_element]['list'][$key] == 3)){ - $hiddenextrafield = ($hover_popup && isset($hover_popup[$key])) ? '' : 'digikanbanhidden'; - - if($key != 'ganttproadvancedcolor' && $key != 'ganttproadvanceddatejalon'&& $key != 'ganttproadvancedtyperelation'){ - $titletask .= '
'; - if(!isset($task->array_options['options_'.$key])){ - $task->array_options['options_'.$key] = ""; - } - $titletask .= ''.$langs->trans($label).': '.$extrafields->showOutputField($key, $task->array_options['options_'.$key], '', $task->table_element).''; - $titletask .= '
'; - } - } - } - } - $titletask .= '
'; - - return $titletask; -} - -function checkIfNeedToBeTransfered($task, &$updatetask, &$tobetransferedto, $option_taskurgent) { - - global $conf; - - $alertbeforedays = ($conf->global->DELEY_ALERTE_DATEJALON > 0) ? $conf->global->DELEY_ALERTE_DATEJALON : 0; - - $datejalon = !empty($task->array_options['options_ganttproadvanceddatejalon']) ? $task->array_options['options_ganttproadvanceddatejalon'] : ''; - // $option_taskurgent = $task->array_options['options_digikanban_taskurgent']; - - - if($datejalon && $task->date_start && $task->date_end) { - - $currentday = strtotime(date('Y-m-d')); - - $coljal = $task->array_options['options_color_datejalon']; - - if((!$coljal || $coljal == 'grey') && $datejalon < $currentday && $task->progress < 100) { - $task->array_options['options_color_datejalon'] = 'red'; - $updatetask = true; - } - elseif($coljal == 'red' && $datejalon >= $currentday && $task->array_options['options_digikanban_taskurgent'] !=1) { - $task->array_options['options_color_datejalon'] = 'grey'; - $updatetask = true; - } - - if($alertbeforedays) { - $datediff = $currentday-$datejalon; - $duration = round($datediff / (60 * 60 * 24)); - - - // if($task->progress < 100) { - if($task->array_options['options_color_datejalon'] != 'green') { - if($alertbeforedays && ($duration >= 0 || ($duration < 0 && abs($duration) <= $alertbeforedays)) && !$option_taskurgent && $task->progress < 100) { - $tobetransferedto = 1; - } - } elseif($task->array_options['options_color_datejalon'] == 'green') { - $tobetransferedto = 2; - } - // if($task->progress == 100 || ($alertbeforedays && ($duration < 0 && abs($duration) > $alertbeforedays) && $option_taskurgent)) { - // } - } - - } - -} - -function contentmodaltask($action, $task, $debut, $fin, $search_projects, $search_status, $type='task') -{ - global $conf, $db, $langs, $user; - - require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.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.'/projet/class/task.class.php'; - dol_include_once('/digikanban/class/digikanban.class.php'); - - $form = new Form($db); - - $extrafields = new ExtraFields($db); - $formother = new FormOther($db); - $kanban = new digikanban($db); - - $tasks = new Task($db); - - $fields_edit_popup = $kanban->fields_edit_popup ? explode(',', $kanban->fields_edit_popup) : []; - - $edit_popup = $fields_edit_popup ? array_flip($fields_edit_popup) : []; - - $html = ''; - $html .= '
'; - - if($type == 'modal'){ - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - } - - $hiddenlabel = ($edit_popup && isset($edit_popup['Label'])) ? '' : 'digikanbanhidden'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - - $hiddenproject = ($edit_popup && isset($edit_popup['Project'])) ? '' : 'digikanbanhidden'; - - if($action == 'addtask' || $type == 'modal'){ - $fk_project = ($type == 'modal') ? ((isset($task->fk_project) && $task->fk_project) ? $task->fk_project : $search_projects) : ''; - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= img_picto($langs->trans('Projects'), 'project', ''); - $html .= $kanban->selectProjectsdigikanbanAuthorized($fk_project, '', $search_status, false, 0, $start="", $end="", $_shownumbertotal = false); - $html .= '
'; - $html .= '
'; - } - - - $hiddenaffectedto = ($edit_popup && isset($edit_popup['AffectedTo'])) ? '' : 'digikanbanhidden'; - - // if($action == 'addtask' || $action == 'clonertask' || $type == 'modal'){ - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - if(isset($task->id) && $task->id && $type == 'task'){ - $tab = $task->liste_contact(-1, 'internal', 0, $kanban->t_typecontact); - $user_id = isset($tab[0]) ? $tab[0]['id'] : 0; - - } - $html .= $form->select_dolusers((!empty($user_id) ? $user_id : (!$task->id ? $user->id : [-1])), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth300 maxwidth300', 1); - $html .= '
'; - $html .= '
'; - - $hiddencontact_tache = ($edit_popup && isset($edit_popup['contact_tache'])) ? '' : 'digikanbanhidden'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $usercontact[] =''; - - if($type == 'task' && ($action == 'edittask' || $action == 'clonertask')){ - $tab = $task->liste_contact(-1, 'internal', 0, 'TASKCONTRIBUTOR'); - // d($tab); - $num = count($tab); - $i = 0; - while ($i < $num) { - $usercontact[]= $tab[$i]['id']; - $i++; - } - }elseif($type == 'modal'){ - $usercontact = !empty($task->usercontact) ? explode(',', $task->usercontact) : ''; - } - - $html .= $form->select_dolusers($usercontact, 'usercontact', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth300 maxwidth300',1,'',true); - $html .= '
'; - $html .= '
'; - - $hiddenperiod = ($edit_popup && isset($edit_popup['Period'])) ? '' : 'digikanbanhidden'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - // $html .= $langs->trans('From').' '; - // $html .= ' '.$langs->trans('to').' '; - $html .= $langs->trans('From').' '.$form->selectDate((!empty($task->date_start) ? $task->date_start : $debut), 'date_start', 1, 1, 0); - $html .= '
'.$langs->trans('to').' '.$form->selectDate((!empty($task->date_end) ? $task->date_end : $fin), 'date_end', -1, -1, 0); - - $html .= '
'; - $html .= '
'; - - $hiddenplannedWorkload = ($edit_popup && isset($edit_popup['PlannedWorkload'])) ? '' : 'digikanbanhidden'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= $kanban->select_duration_kanabn('planned_workload', (!empty($task->planned_workload) ? $task->planned_workload : ''), 0, 'text'); - - $html .= '
'; - $html .= '
'; - - $hiddenprogressdeclared = ($edit_popup && isset($edit_popup['ProgressDeclared'])) ? '' : 'digikanbanhidden'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= $formother->select_percent((!empty($task->progress) ? $task->progress : ''), 'progress', 0, 1, 0, 100); - $html .= '
'; - $html .= '
'; - - $hiddendescription = ($edit_popup && isset($edit_popup['Description'])) ? '' : 'digikanbanhidden'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - - $hiddenbudget = ($edit_popup && isset($edit_popup['Budget'])) ? '' : 'digikanbanhidden'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - - $extrafields->fetch_name_optionals_label($tasks->table_element); - // d($extrafields, false); - - - if($extrafields->attributes[$tasks->table_element]['label']){ - foreach ($extrafields->attributes[$tasks->table_element]['label'] as $key => $value) { - - $hiddenextrafields = ($edit_popup && isset($edit_popup[$key])) ? '' : 'digikanbanhidden'; - - $visibi = $extrafields->attributes[$tasks->table_element]['list'][$key]; - if(!$visibi) continue; - - if($key == 'ganttproadvancedcolor'){ - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - }elseif($key != 'color_datejalon' && $key != 'ganttproadvancedtyperelation' && $key != 'digikanban_colomn'){ - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= $extrafields->showInputField($key, (!empty($task->array_options["options_".$key]) ? $task->array_options["options_".$key] : ''), '', $keysuffix = '', '', 0, '', $tasks->table_element); - $html .= '
'; - $html .= '
'; - - } - } - - } - $html .= '
'; - return $html; -} - -function selectCheckModal($id_modal) +/* Copyright (C) 2024 EVARISK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file lib/digikanban.lib.php + * \ingroup digikanban + * \brief Library files with common functions for Admin conf. + */ + +/** + * Prepare array of tabs for admin. + * + * @return array Array of tabs. + */ + +function digikanban_admin_prepare_head($active, $linkback, $picto) { - global $langs, $db; - - $tags=''; - $html=''; - $data = array(); - $htmlname = 'digikanban_checklist'; - - $sql = 'SELECT o.checklist FROM '.MAIN_DB_PREFIX.'digikanban_modeles as o'; - $sql .= ' WHERE o.rowid = '.$id_modal; - $resql = $db->query($sql); - $html ='
    '; - $arr_check = array(); - - $checked = ''; - - if($resql){ - while ($obj = $db->fetch_object($resql)) { - - $checklist = unserialize($obj->checklist); - if($checklist && count($checklist)>0){ - foreach ($checklist as $key => $check) { - $id = $key+1; - $label = (is_array($check) && isset($check['label'])) ? $check['label'] : $check; - $numcheck = (is_array($check) && isset($check['numcheck'])) ? $check['numcheck'] : $id; - - $tag = '
  • '; - $tag .= ''; - $tag .= ''; - $tag .= ''; - $tag .= ''; - $tag .= '
    '; - $tag .= ' '; - $tag .= ''; - - $tag .= ''; - $tag .= ''; - $tag .= ''; - $tag .= ''; - $tag .= ''; - $tag .= ''.img_delete().''; - $tag .= ''.img_edit().''; - $tag .= '
    '; - $tag .= '
  • '; - - $arr_check[$numcheck] = $tag; - } - } - ksort($arr_check, SORT_REGULAR); - } - } - $html .='
'; + // Global variables definitions. + global $langs; - $html = '
'; - $html .= ''; - $html .= '
    '; - foreach ($arr_check as $key => $ttag) { - $html .= $ttag; - } - $html .= '
'; - $html .= '
'; - - $html .= '
'; - $html .= ' '.$langs->trans('createcheck').''; - $html .= '
'; - - return $html; -} - - -function digikanbanPrepareAdminHead($active, $linkback, $picto) -{ - global $langs, $conf, $db, $user; + // Load translation files required by the page. + saturne_load_langs(); - $langs->load('digikanban@digikanban'); - $h = 0; - $head = array(); - $assets = new digikanban($db); + // Initialize values. + $h = 0; + $head = []; - $head[$h][0] = dol_buildpath("/digikanban/admin/admin.php", 1); + $head[$h][0] = dol_buildpath("/digikanban/admin/setup.php", 1); $head[$h][1] = $langs->trans("General"); $head[$h][2] = 'general'; $h++; @@ -866,6 +53,6 @@ function digikanbanPrepareAdminHead($active, $linkback, $picto) print load_fiche_titre($langs->trans("config_vue_kanban"), $linkback, $picto); - dol_fiche_head($head, $active, $langs->trans('config_vue_kanban'), -1, 'list'); + dol_get_fiche_head($head, $active, $langs->trans('config_vue_kanban'), -1, 'list'); } \ No newline at end of file diff --git a/lib/digikanban_functions.lib.php b/lib/digikanban_functions.lib.php new file mode 100644 index 0000000..652cde5 --- /dev/null +++ b/lib/digikanban_functions.lib.php @@ -0,0 +1,738 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file lib/digikanban_function.lib.php + * \ingroup digikanban + * \brief Library files with common functions for Digiriskdolibarr + */ + +function digikanban_tasks_admin_prepare_head($tosendinurl='') +{ + // Global variables definitions. + global $langs, $conf, $db, $user; + + // Load translation files required by the page. + saturne_load_langs(); + + $h = 0; + $head = []; + + if ($conf->ganttproadvanced->enabled) { + $head[$h][0] = dol_buildpath("/ganttproadvanced/index.php?mode=gantt" . $tosendinurl, 1); + $head[$h][1] = $langs->trans("viewgantt"); + $head[$h][2] = 'gantt'; + $h++; + + $search_scale = GETPOST("scale", 'alpha'); + if ($search_scale) { + $resusrs = dol_set_user_param($db, $conf, $user, ['GANTTPROADVANCED_DEFAULT_ZOOM_BY' => $search_scale]); + } + } + + + $head[$h][0] = dol_buildpath("/digikanban/index.php?mode=kanban" . $tosendinurl, 1); + $head[$h][1] = $langs->trans("viewkanban"); + $head[$h][2] = 'kanban'; + $h++; + + return $head; +} + + + +function get_task_element($object, $task, $status=[], $currentColomn='') +{ + global $db, $langs, $conf; + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + + require_once __DIR__ . '/../class/digikanban_tags.class.php'; + require_once __DIR__ . '/../class/digikanban_checklist.class.php'; + require_once __DIR__ . '/../class/digikanban_commnts.class.php'; + + $form = new Form($db); + $kanban = new digikanban($db); + $digikanban_tags = new digikanban_tags($db); + $checklist = new digikanban_checklist($db); + $getchecklist = new digikanban_checklist($db); + $kanbancommnts = new digikanban_commnts($db); + + $colorgantt = ''; + $color = $object->color ? $object->color : ($colorgantt ? $colorgantt : '#00ffff'); + $clr = ''; + $arr_color = colorStringToArray($color); + if ($arr_color) { + foreach ($arr_color as $value) { + $clr .= $value . ', '; + } + } + $bgcolor = $clr ? 'rgb('.$clr.'0.3)' : $color; + $descrptask = ''; + $descrptask .= '' . $langs->trans('Description') . ': '; + $descrptask .= '' . $object->description . ': '; + + $debutday = $task->date_start ? date('d', $task->date_start) : ''; + $debutmonth = $task->date_start ? date('m', $task->date_start) : ''; + $debutyear = $task->date_start ? date('Y', $task->date_start) : ''; + + $finday = $task->date_end ? date('d', $task->date_end) : ''; + $finmonth = $task->date_end ? date('m', $task->date_end) : ''; + $finyear = $task->date_end ? date('Y', $task->date_end) : ''; + + $dd = dol_getdate(dol_now()); + $now = dol_mktime(0, 0, 0, $dd['mon'], $dd['mday'], $dd['year']); + + $tags = $digikanban_tags->fetchAllTagsOfTask($task->id); + $checklist = $checklist->calcProgressCheckTask($task->id); + + $html = '
'; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + + $titletask = kanban_get_title_of_current_task($task); + $html .= '
'; + $titledescp = '
'; + $titledescp .= '
'; + $titledescp .= ''.$langs->trans("Description").': '; + $titledescp .= ''.$task->description.''; + $titledescp .= '
'; + $titledescp .= '
'; + $html .= '
'; + $alltag = ''; + if ($tags && count($tags) > 0) { + $i = 0; + $alltag = ''; + $txt_tag = ''; + $div_tag = ''; + foreach ($tags as $value) { + $color = $value['color'] ? $value['color'] : '#00ffff'; + $clr = ''; + $arr_color = colorStringToArray($color); + if ($arr_color) { + foreach ($arr_color as $value1) { + $clr .= $value1 . ', '; + } + } + $bgcolor = $clr ? 'rgb(' . $clr . '0.3)' : $color; + if ($i < 2) { + $html .= ''; + $html .= ''; + $html .= ''; + $html .= $value['label']; + $html .= ''; + } else { + $txt_tag .= ''; + $txt_tag .= ''; + $txt_tag .= ''.$value['label'].''; + $txt_tag .= ''; + + } + $i++; + } + $div_tag .= '
'; + $div_tag .= $txt_tag; + $div_tag .= '
'; + if (count($tags) > 2) { + $alltag = '...'; + } + } + + $html .= $alltag; + $html .= '+'; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '' . img_edit() . ''; + $html .= '
'; + + $fields_hover_popup = $kanban->fields_hover_popup ? explode(',', $kanban->fields_hover_popup) : []; + $hover_popup = $fields_hover_popup ? array_flip($fields_hover_popup) : []; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= img_picto('', $task->picto, 'class="pictofixedwidth"'); + + if (isset($hover_popup['Ref'])) { + $html .= $task->ref . ($task->label ? ' - ' : ''); + } + $html .= ''; + $html .= $task->label; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= img_picto('', 'project', 'class="pictofixedwidth"'); + $html .= ''; + + if (isset($hover_popup['NumProjet'])) { + $html .= $object->ref_proj.($object->label_proj ? ' - ' : ''); + } + $html .= $object->label_proj; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= img_picto('', 'calendar', 'class="pictofixedwidth"'); + $html .= ''; + $html .= $task->date_start ? dol_print_date($task->date_start, 'dayhour') : ''; + $html .= $task->date_start && $task->date_end ? ' - ' : ''; + $html .= $task->date_end ? dol_print_date($task->date_end, 'dayhour') : ''; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= '
'; + + $date_jalon = (!empty($task->array_options['options_ganttproadvanceddatejalon']) ? $task->array_options['options_ganttproadvanceddatejalon'] : ''); + $name_color = (!empty($task->array_options['options_color_datejalon']) ? $task->array_options['options_color_datejalon'] : 'grey'); + + if($currentColomn == 'enattent'){ + $name_color = (($date_jalon <= $now ) ? 'red' : $name_color); + } + + $color = $status[$name_color]; + if ($date_jalon) { + $datejalontitle = $langs->trans("Progress") . ': ' . ($task->progress ? $task->progress : 0) . ' %'; + $html .= ''; + $html .= ' ' . dol_print_date($date_jalon, '%d %b'); + $html .= ''; + + $tobetransferedto = 0; + $updatetask = false; + check_if_need_to_be_transfered($task, $updatetask, $tobetransferedto, $option_taskurgent = 0); + + $html .= ''; + if ($tobetransferedto == 1) { + $html .= img_error($langs->trans('DELEY_ALERTE_DATEJALON')); + } else { + $html .= img_warning($langs->trans('urgentskanban')); + } + $html .= ''; + } + $html .= ' '; + if ($task->description) { + $html .= ''; + } + $cl_check = $checklist['percent'] == 100 ? 'checklist100' : ''; + $hover_checklist = $getchecklist->selectCheck($task->id, 1); + $tmptitle = $hover_checklist ? 'title="' . dol_escape_htmltag($hover_checklist, 0, 1) . '"' : ''; + + $html .= ''; + $html .=''; + $html .= $checklist['total'] ? ' '.$checklist['checked'].'/'.$checklist['total'].'' : ''; + $html .=''; + + $spntxtcmt = ''; + + $spntxtcmt .= ''; + if ($object->nb_comments) { + $spntxtcmt .= ($object->nb_comments < 9) ? $object->nb_comments : '+9'; + } + $spntxtcmt .= ''; + + $hover_comments = $kanbancommnts->getcomments($task->id); + $tmptitlecmt = $hover_comments['htmlhover'] ? 'title="'.dol_escape_htmltag($hover_comments['htmlhover'], 0, 1).'"' : ''; + + $html .= ''.$spntxtcmt.''; + $html .= '
'; + + $maxnumbercontactstodisplay = $kanban->maxnumbercontactstodisplay; + + $html .= '
'; + + + // Contact Principal + $i = 0; + $affctedto = ''; + $tab = $task->liste_contact(-1, 'internal', 0, $kanban->t_typecontact); + $userstatic = new User($db); + + if (isset($tab[$i]) && $tab[$i]['id']) { + $userstatic->id = $tab[$i]['id']; + $userstatic->lastname = $tab[$i]['lastname']; + $userstatic->firstname = $tab[$i]['firstname']; + $userstatic->email = $tab[$i]['email']; + $userstatic->photo = $tab[$i]['photo']; + $userstatic->statut = 1; + $affctedto_id = $userstatic->id; + $affctedto = $userstatic->getNomUrl(-2); + } + + //Contact Contributor + $jscontact=''; + if ($maxnumbercontactstodisplay > 0) { + $tab = $task->liste_contact(-1, 'internal', 0, 'TASKCONTRIBUTOR'); + $num = count($tab); + $i = 0; + $htmlcontact = ''; + + if ($num) { + while ($i < $num) { + if (isset($tab[$i]) && $tab[$i]['id']) { + $userstatic = new User($db); + if($affctedto_id != $tab[$i]['id'] || ($affctedto_id == $tab[$i]['id'] && $kanban->t_typecontact != 'TASKCONTRIBUTOR')){ + $userstatic->id = $tab[$i]['id']; + $userstatic->lastname = $tab[$i]['lastname']; + $userstatic->firstname = $tab[$i]['firstname']; + $userstatic->email = $tab[$i]['email']; + $userstatic->photo = $tab[$i]['photo']; + $userstatic->statut = 1; + if ($i < $maxnumbercontactstodisplay) { + $htmlcontact .= ''.$userstatic->getNomUrl(-2).''; + } else { + $jscontact .= ' - '.$form->showphoto('userphoto', $userstatic, 0, 0, 0, 'userphoto', 'mini', 0, 1).' '.dol_string_nohtmltag($userstatic->getFullName($langs, '')).'
'; + } + + } + + } + $i++; + } + if ($jscontact) { + $jscontact = '' . $langs->trans('OtherContact') . ':
' . $jscontact; + $htmlcontact = '... '.$htmlcontact; + } + $html .= $htmlcontact; + } + } + + + $html .= $affctedto ? ''.$affctedto.'' : ''; + $html .= '
'; + $html .= '
'; + $html .= '
'; + + return $html; +} + +function kanban_get_title_of_current_task($task) +{ + global $db, $langs, $conf; + + $kanban = new digikanban($db); + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label($task->table_element); + + $fields_hover_popup = $kanban->fields_hover_popup ? explode(',', $kanban->fields_hover_popup) : []; + $hover_popup = $fields_hover_popup ? array_flip($fields_hover_popup) : []; + $hiddenperiode = ($hover_popup && isset($hover_popup['Period'])) ? '' : 'digikanbanhidden'; + $titletask = '
'; + $titletask .= '
'; + $titletask .= ''; + $titletask .= $task->date_start ? dol_print_date($task->date_start, "%d %B %Y") : '?'; + $titletask .= $task->date_end ? ' - '.dol_print_date($task->date_end, "%d %B %Y") : ' - ?'; + $titletask .= ''; + $titletask .= '
'; + + $hiddenlabel = ($hover_popup && isset($hover_popup['Label'])) ? '' : 'digikanbanhidden'; + + $titletask .= '
'; + $titletask .= ''; + $titletask .= img_picto('', $task->picto) . ' '; + + if (isset($hover_popup['Ref'])) { + $titletask .= $task->ref . (($task->label && isset($hover_popup['Label'])) ? ' - ' : ''); + } + + $titletask .= $task->label; + $titletask .= ''; + $titletask .= '
'; + + if ($task->fk_task_parent) { + $taskparent = new Task($db); + $taskparent->fetch($task->fk_task_parent); + $titletask .= '
'; + $titletask .= '' . $langs->trans('ChildOfTask') . ': ' . $taskparent->ref . ' - ' . $taskparent->label . ' '; + $titletask .= ''; + $titletask .= '
'; + } + $duration = 0; + if ($task->date_start && $task->date_end) { + $_start = $task->date_start; + $_end = $task->date_end; + $datediff = $_end-$_start; + $duration = round($datediff / (60 * 60 * 24)); + } + $hiddenduree = ($hover_popup && isset($hover_popup['Duration'])) ? '' : 'digikanbanhidden'; + + $titletask .= '
'; + $titletask .= '' . $langs->trans('Duration') . ': ' . $duration . ' ' . strtolower($langs->trans("Days")) . ' '; + $titletask .= '
'; + + $hiddenplannedwork = ($hover_popup && isset($hover_popup['PlannedWorkload'])) ? '' : 'digikanbanhidden'; + + $titletask .= '
'; + $planned_workload = ($task->planned_workload != '') ? convertSecondToTime($task->planned_workload, 'allhourmin') : '--:--'; + $titletask .= '' . $langs->trans('PlannedWorkload') . ': ' . $planned_workload . ' '; + $titletask .= '
'; + + $timespent = ($task->duration_effective) ? convertSecondToTime($task->duration_effective, 'allhourmin') : '--:--'; + $hiddentimespent = ($hover_popup && isset($hover_popup['TimeSpent'])) ? '' : 'digikanbanhidden'; + + $titletask .= '
'; + $titletask .= '' . $langs->trans("TimeSpent") . ': ' . $timespent . ''; + $titletask .= '
'; + + $hiddenprogress = ($hover_popup && isset($hover_popup['ProgressDeclared'])) ? '' : 'digikanbanhidden'; + + $titletask .= '
'; + $titletask .= '' . $langs->trans("Progress") . ': ' . ($task->progress ? $task->progress . ' %' : '') . ''; + $titletask .= '
'; + + $tab = $task->liste_contact(-1, 'internal', 0, $kanban->t_typecontact); + $userstatic = new User($db); + $affctedto = ''; + $i = 0; + + if (isset($tab[$i]) && $tab[$i]['id'] ){ + $userstatic->id = $tab[$i]['id']; + $userstatic->lastname = $tab[$i]['lastname']; + $userstatic->firstname = $tab[$i]['firstname']; + $userstatic->email = $tab[$i]['email']; + $userstatic->photo = $tab[$i]['photo']; + $userstatic->statut = 1; + $affctedto = $userstatic->getNomUrl(-1, 0); + } + + $hiddenaffectedt = ($hover_popup && isset($hover_popup['AffectedTo'])) ? '' : 'digikanbanhidden'; + $titletask .= '
'; + $titletask .= '' . $langs->trans("AffectedTo") . ': ' . $affctedto . ''; + $titletask .= '
'; + + + $hiddenjalondate = ($hover_popup && isset($hover_popup['JalonDate'])) ? '' : 'digikanbanhidden'; + + $titletask .= '
'; + $date_jalon = (!empty($task->array_options['options_ganttproadvanceddatejalon']) ? dol_print_date($task->array_options['options_ganttproadvanceddatejalon'], 'day') : ''); + $titletask .= '' . $langs->trans("ganttproadvanceddatejalon") . ': ' . $date_jalon . ''; + $titletask .= '
'; + + $hiddendescription = ($hover_popup && isset($hover_popup['Description'])) ? '' : 'digikanbanhidden'; + $titletask .= '
'; + $titletask .= '' . $langs->trans("Description") . ': ' . $task->description . ''; + $titletask .= '
'; + + $hiddenbudgets = ($hover_popup && isset($hover_popup['Budget'])) ? '' : 'digikanbanhidden'; + $titletask .= '
'; + $titletask .= '' . $langs->trans("Budget") . ': ' . price($task->budget_amount) . ''; + $titletask .= '
'; + + $coutstemepconsomme = $kanban->coutstemepconsomme($task->id); + $hiddentotalcoutstemp = ($hover_popup && isset($hover_popup['totalcoutstemp'])) ? '' : 'digikanbanhidden'; + $titletask .= '
'; + $titletask .= '' . $langs->trans("totalcoutstemp") . ': ' . price($coutstemepconsomme) . ''; + $titletask .= '
'; + + if ($extrafields->attributes[$task->table_element]['label']) { + foreach ($extrafields->attributes[$task->table_element]['label'] as $key => $label) { + if (($extrafields->attributes[$task->table_element]['list'][$key] == 1 || $extrafields->attributes[$task->table_element]['list'][$key] == 3)) { + $hiddenextrafield = ($hover_popup && isset($hover_popup[$key])) ? '' : 'digikanbanhidden'; + + if ($key != 'ganttproadvancedcolor' && $key != 'ganttproadvanceddatejalon'&& $key != 'ganttproadvancedtyperelation') { + $titletask .= '
'; + if (!isset($task->array_options['options_' . $key])) { + $task->array_options['options_' . $key] = ""; + } + $titletask .= '' . $langs->trans($label) . ': ' . $extrafields->showOutputField($key, $task->array_options['options_' . $key], '', $task->table_element) . ''; + $titletask .= '
'; + } + } + } + } + $titletask .= '
'; + + return $titletask; +} + +function check_if_need_to_be_transfered($task, &$updatetask, &$tobetransferedto, $option_taskurgent) +{ + global $conf; + + $alertbeforedays = ($conf->global->DELEY_ALERTE_DATEJALON > 0) ? $conf->global->DELEY_ALERTE_DATEJALON : 0; + $datejalon = !empty($task->array_options['options_ganttproadvanceddatejalon']) ? $task->array_options['options_ganttproadvanceddatejalon'] : ''; + + if($datejalon && $task->date_start && $task->date_end) { + $currentday = strtotime(date('Y-m-d')); + $coljal = $task->array_options['options_color_datejalon']; + + if ((!$coljal || $coljal == 'grey') && $datejalon < $currentday && $task->progress < 100) { + $task->array_options['options_color_datejalon'] = 'red'; + $updatetask = true; + } elseif ($coljal == 'red' && $datejalon >= $currentday && $task->array_options['options_digikanban_taskurgent'] !=1) { + $task->array_options['options_color_datejalon'] = 'grey'; + $updatetask = true; + } + + if ($alertbeforedays) { + $datediff = $currentday-$datejalon; + $duration = round($datediff / (60 * 60 * 24)); + if ($task->array_options['options_color_datejalon'] != 'green') { + if($alertbeforedays && ($duration >= 0 || ($duration < 0 && abs($duration) <= $alertbeforedays)) && !$option_taskurgent && $task->progress < 100) { + $tobetransferedto = 1; + } + } elseif($task->array_options['options_color_datejalon'] == 'green') { + $tobetransferedto = 2; + } + } + } +} + +function contentmodaltask($action, $task, $debut, $fin, $search_projects, $search_status, $type='task') +{ + global $conf, $db, $langs, $user; + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.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.'/projet/class/task.class.php'; + + require_once __DIR__ . '/../class/digikanban.class.php'; + + $form = new Form($db); + $extrafields = new ExtraFields($db); + $formother = new FormOther($db); + $kanban = new digikanban($db); + $tasks = new Task($db); + + $fields_edit_popup = $kanban->fields_edit_popup ? explode(',', $kanban->fields_edit_popup) : []; + $edit_popup = $fields_edit_popup ? array_flip($fields_edit_popup) : []; + + $html = ''; + $html .= '
'; + + if ($type == 'modal') { + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + } + $hiddenlabel = ($edit_popup && isset($edit_popup['Label'])) ? '' : 'digikanbanhidden'; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + + $hiddenproject = ($edit_popup && isset($edit_popup['Project'])) ? '' : 'digikanbanhidden'; + + if($action == 'addtask' || $type == 'modal'){ + $fk_project = ($type == 'modal') ? ((isset($task->fk_project) && $task->fk_project) ? $task->fk_project : $search_projects) : ''; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= img_picto($langs->trans('Projects'), 'project', ''); + $html .= $kanban->selectProjectsdigikanbanAuthorized($fk_project, '', $search_status, false, 0, $start="", $end="", $_shownumbertotal = false); + $html .= '
'; + $html .= '
'; + } + $hiddenaffectedto = ($edit_popup && isset($edit_popup['AffectedTo'])) ? '' : 'digikanbanhidden'; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + if (isset($task->id) && $task->id && $type == 'task') { + $tab = $task->liste_contact(-1, 'internal', 0, $kanban->t_typecontact); + $user_id = isset($tab[0]) ? $tab[0]['id'] : 0; + } + $html .= $form->select_dolusers((!empty($user_id) ? $user_id : (!$task->id ? $user->id : [-1])), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth300 maxwidth300', 1); + $html .= '
'; + $html .= '
'; + + $hiddencontact_tache = ($edit_popup && isset($edit_popup['contact_tache'])) ? '' : 'digikanbanhidden'; + + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $usercontact[] =''; + + if ($type == 'task' && ($action == 'edittask' || $action == 'clonertask')) { + $tab = $task->liste_contact(-1, 'internal', 0, 'TASKCONTRIBUTOR'); + $num = count($tab); + $i = 0; + while ($i < $num) { + $usercontact[] = $tab[$i]['id']; + $i++; + } + } elseif($type == 'modal') { + $usercontact = !empty($task->usercontact) ? explode(',', $task->usercontact) : ''; + } + $html .= $form->select_dolusers($usercontact, 'usercontact', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth300 maxwidth300',1,'',true); + $html .= '
'; + $html .= '
'; + + $hiddenperiod = ($edit_popup && isset($edit_popup['Period'])) ? '' : 'digikanbanhidden'; + + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= $langs->trans('From') . ' ' . $form->selectDate((!empty($task->date_start) ? $task->date_start : $debut), 'date_start', 1, 1, 0); + $html .= '
' . $langs->trans('to') . ' ' . $form->selectDate((!empty($task->date_end) ? $task->date_end : $fin), 'date_end', -1, -1, 0); + $html .= '
'; + + $hiddenplannedWorkload = ($edit_popup && isset($edit_popup['PlannedWorkload'])) ? '' : 'digikanbanhidden'; + + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= $kanban->select_duration_kanabn('planned_workload', (!empty($task->planned_workload) ? $task->planned_workload : ''), 0, 'text'); + $html .= '
'; + + $hiddenprogressdeclared = ($edit_popup && isset($edit_popup['ProgressDeclared'])) ? '' : 'digikanbanhidden'; + + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= $formother->select_percent((!empty($task->progress) ? $task->progress : ''), 'progress', 0, 1, 0, 100); + $html .= '
'; + + $hiddendescription = ($edit_popup && isset($edit_popup['Description'])) ? '' : 'digikanbanhidden'; + + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + + $hiddenbudget = ($edit_popup && isset($edit_popup['Budget'])) ? '' : 'digikanbanhidden'; + + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + + $extrafields->fetch_name_optionals_label($tasks->table_element); + + if ($extrafields->attributes[$tasks->table_element]['label']) { + foreach ($extrafields->attributes[$tasks->table_element]['label'] as $key => $value) { + $hiddenextrafields = ($edit_popup && isset($edit_popup[$key])) ? '' : 'digikanbanhidden'; + $visibi = $extrafields->attributes[$tasks->table_element]['list'][$key]; + if (!$visibi) { + continue; + } + if ($key == 'ganttproadvancedcolor') { + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + } elseif($key != 'color_datejalon' && $key != 'ganttproadvancedtyperelation' && $key != 'digikanban_colomn'){ + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + $html .= $extrafields->showInputField($key, (!empty($task->array_options["options_" . $key]) ? $task->array_options["options_" . $key] : ''), '', $keysuffix = '', '', 0, '', $tasks->table_element); + $html .= '
'; + } + } + } + $html .= '
'; + return $html; +} + +function select_check_modal($id_modal) +{ + global $langs, $db, $moduleName; + + $tags = ''; + $html = ''; + $data = []; + $htmlname = 'digikanban_checklist'; + + $sql = 'SELECT o.checklist FROM ' . MAIN_DB_PREFIX . $moduleName . '_modeles as o'; + $sql .= ' WHERE o.rowid = ' . $id_modal; + $resql = $db->query($sql); + $html ='
    '; + $arr_check = []; + $checked = ''; + + if ($resql) { + while ($obj = $db->fetch_object($resql)) { + $checklist = unserialize($obj->checklist); + if ($checklist && count($checklist)>0) { + foreach ($checklist as $key => $check) { + $id = $key + 1; + $label = (is_array($check) && isset($check['label'])) ? $check['label'] : $check; + $numcheck = (is_array($check) && isset($check['numcheck'])) ? $check['numcheck'] : $id; + + $tag = '
  • '; + $tag .= ''; + $tag .= ''; + $tag .= ''; + $tag .= ''; + $tag .= '
    '; + $tag .= ' '; + $tag .= ''; + $tag .= ''; + $tag .= ''; + $tag .= ''; + $tag .= ''; + $tag .= ''; + $tag .= '' . img_delete() . ''; + $tag .= '' . img_edit() . ''; + $tag .= '
    '; + $tag .= '
  • '; + + $arr_check[$numcheck] = $tag; + } + } + ksort($arr_check, SORT_REGULAR); + } + } + $html .='
'; + $html = '
'; + $html .= ''; + $html .= '
    '; + foreach ($arr_check as $ttag) { + $html .= $ttag; + } + $html .= '
'; + $html .= '
'; + $html .= '
'; + $html .= ' ' . $langs->trans('createcheck') . ''; + $html .= '
'; + + return $html; +} \ No newline at end of file