28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
36$langs->loadLangs(array(
'projects',
'other'));
37$hookmanager->initHooks(array(
'projectcarddocument'));
39$action =
GETPOST(
'action',
'alpha');
40$confirm =
GETPOST(
'confirm',
'alpha');
43$mine = (
GETPOST(
'mode',
'alpha') ==
'mine' ? 1 : 0);
48include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
49if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object,
'fetchComments') && empty(
$object->comments)) {
53if ($id > 0 || !empty($ref)) {
59$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
60$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
62if (empty($page) || $page == -1) {
65$offset = $limit * $page;
88$permissiontoadd = $user->hasRight(
'projet',
'creer');
95include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
102$title = $langs->trans(
'Documents').
' - '.
$object->ref.
' '.
$object->name;
104 $title =
$object->ref.
' '.
$object->name.
' - '.$langs->trans(
'Document');
107$help_url =
'EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte';
109llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-project page-card_document');
111$form =
new Form($db);
118 $userWrite =
$object->restrictedProjectArea($user,
'write');
126 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
128 foreach ($filearray as $key => $file) {
129 $totalsize += $file[
'size'];
135 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
136 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
137 $tmpurl = preg_replace(
'/__SOCID__/', (
string)
$object->socid, $tmpurl);
138 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
140 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
143 $morehtmlref =
'<div class="refidno">';
145 $morehtmlref .=
$object->title;
147 if (!empty(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
148 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
150 $morehtmlref .=
'</div>';
153 if (!$user->hasRight(
'projet',
'all',
'lire')) {
154 $objectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 0);
155 $object->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0').
")";
158 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
161 print
'<div class="fichecenter">';
162 print
'<div class="underbanner clearboth"></div>';
164 print
'<table class="border tableforfield centpercent">';
167 print
'<tr><td class="titlefield">'.$langs->trans(
"NbOfAttachedFiles").
'</td><td>'.count($filearray).
'</td></tr>';
168 print
'<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td>'.
dol_print_size($totalsize, 1, 1).
'</td></tr>';
177 $modulepart =
'projet';
178 $permissiontoadd = ($userWrite > 0);
179 $permtoedit = ($userWrite > 0);
180 include DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage projects.
dol_dir_list($utf8_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 formatted size.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.