27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
35 $langs->loadLangs(array(
'projects',
'other'));
36 $hookmanager->initHooks(array(
'projectcarddocument'));
38 $action =
GETPOST(
'action',
'alpha');
39 $confirm =
GETPOST(
'confirm',
'alpha');
42 $mine = (
GETPOST(
'mode',
'alpha') ==
'mine' ? 1 : 0);
47 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
48 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object,
'fetchComments') && empty($object->comments)) {
49 $object->fetchComments();
52 if ($id > 0 || !empty($ref)) {
57 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
58 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
59 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
61 if (empty($page) || $page == -1) {
64 $offset = $limit * $page;
65 $pageprev = $page - 1;
66 $pagenext = $page + 1;
68 if (!empty($conf->global->MAIN_DOC_SORT_FIELD)) {
69 $sortfield = $conf->global->MAIN_DOC_SORT_FIELD;
71 if (!empty($conf->global->MAIN_DOC_SORT_ORDER)) {
72 $sortorder = $conf->global->MAIN_DOC_SORT_ORDER;
87 $permissiontoadd = $user->rights->projet->creer;
94 include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
101 $title = $langs->trans(
'Documents').
' - '.$object->ref.
' '.$object->name;
102 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
103 $title = $object->ref.
' '.$object->name.
' - '.$langs->trans(
'Document');
106 $help_url =
'EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte';
112 if ($object->id > 0) {
117 $userWrite = $object->restrictedProjectArea($user,
'write');
122 print
dol_get_fiche_head($head,
'document', $langs->trans(
"Project"), -1, ($object->public ?
'projectpub' :
'project'));
125 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ?SORT_DESC:SORT_ASC), 1);
127 foreach ($filearray as $key => $file) {
128 $totalsize += $file[
'size'];
134 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
136 $morehtmlref =
'<div class="refidno">';
138 $morehtmlref .= $object->title;
140 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
141 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
143 $morehtmlref .=
'</div>';
146 if (empty($user->rights->projet->all->lire)) {
147 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
148 $object->next_prev_filter =
" rowid IN (".$db->sanitize(count($objectsListId) ?join(
',', array_keys($objectsListId)) :
'0').
")";
151 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
154 print
'<div class="fichecenter">';
155 print
'<div class="underbanner clearboth"></div>';
157 print
'<table class="border tableforfield centpercent">';
160 print
'<tr><td class="titlefield">'.$langs->trans(
"NbOfAttachedFiles").
'</td><td>'.count($filearray).
'</td></tr>';
161 print
'<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td>'.
dol_print_size($totalsize, 1, 1).
'</td></tr>';
170 $modulepart =
'projet';
171 $permissiontoadd = ($userWrite > 0);
172 $permtoedit = ($userWrite > 0);
173 include DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Class to manage projects.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(isset($_GET["hashp"]) &&!defined("NOLOGIN")) if((isset($_GET["modulepart"]) && $_GET["modulepart"]=='medias')) llxHeader()
Header empty.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formated size.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.