33require
'../main.inc.php';
41require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
49$langs->loadLangs(array(
'companies',
'projects'));
51$action =
GETPOST(
'action',
'aZ09');
52$massaction =
GETPOST(
'massaction',
'alpha');
53$confirm =
GETPOST(
'confirm',
'alpha');
55$toselect =
GETPOST(
'toselect',
'array:int');
61 $socid = $user->socid;
65$hookmanager->initHooks(array(
'thirdpartyproject',
'projectthirdparty'));
70$permissiontodelete = $user->hasRight(
'societe',
'supprimer');
79if (
GETPOST(
'cancel',
'alpha')) {
82if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
84 $massactionbutton =
'';
87$parameters = array(
'id' => $socid);
88$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
94$arrayofmassactions = array();
95if (!empty($permissiontodelete)) {
96 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
98if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
99 $arrayofmassactions = array();
102if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preenable',
'preclose'))) {
103 $arrayofmassactions = array();
107$objectclass =
'Project';
108$objectlabel =
'Project';
109$uploaddir = $conf->societe->dir_output;
110include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
112$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
119unset($_SESSION[
'pageforbacktolist'][
'project']);
121 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
122 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
124 $langs->load(
"companies");
126 $result =
$object->fetch($socid);
128 $title = $langs->trans(
"Projects");
130 $title =
$object->name.
" - ".$title;
136 print
dol_get_fiche_head($head,
'project', $langs->trans(
"ThirdParty"), -1,
'company');
138 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
140 dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
142 print
'<div class="fichecenter">';
144 print
'<div class="underbanner clearboth"></div>';
145 print
'<table class="border centpercent tableforfield">';
149 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
154 print
'<tr><td class="titlefield">';
155 print $langs->trans(
'CustomerCode').
'</td><td colspan="3">';
157 $tmpcheck =
$object->check_codeclient();
158 if ($tmpcheck != 0 && $tmpcheck != -5) {
159 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
165 print
'<tr><td class="titlefield">';
166 print $langs->trans(
'SupplierCode').
'</td><td colspan="3">';
168 $tmpcheck =
$object->check_codefournisseur();
169 if ($tmpcheck != 0 && $tmpcheck != -5) {
170 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
182 $backtopage = $_SERVER[
'PHP_SELF'].
'?socid='.
$object->id;
183 $newcardbutton =
dolGetButtonTitle($langs->trans(
"NewProject"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/projet/card.php?action=create&socid='.
$object->id.
'&backtopageforcancel='.urlencode($backtopage),
'', 1, $params);
185 if (empty($conf->dol_optimize_smallscreen)) {
186 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'?socid='.
$object->id.
'">';
187 print
'<input type="hidden" name="token" value="'.newToken().
'">';
193 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
194 $arrayofselected = is_array($toselect) ? $toselect : array();
197 $result =
show_projects($conf, $langs, $db, $object, $_SERVER[
"PHP_SELF"].
'?socid='.
$object->id, 1, $newcardbutton, $massactionbutton);
199 if (empty($conf->dol_optimize_smallscreen)) {
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 third parties objects (customers, suppliers, prospects...)
show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0, $morehtmlright='', $massactionbutton='')
Show html area for list of projects.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
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, $morecssdiv='')
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.