2015-04-22 15:23:54 +00:00
< ? php
/**
* Implementation of CheckInDocument view
*
* @ category DMS
* @ package SeedDMS
* @ license GPL 2
* @ version @ version @
* @ author Uwe Steinmann < uwe @ steinmann . cx >
* @ copyright Copyright ( C ) 2015 Uwe Steinmann
* @ version Release : @ package_version @
*/
/**
* Include parent class
*/
require_once ( " class.Bootstrap.php " );
/**
* Class which outputs the html page for Document view
*
* @ category DMS
* @ package SeedDMS
* @ author Markus Westphal , Malcolm Cowe , Uwe Steinmann < uwe @ steinmann . cx >
* @ copyright Copyright ( C ) 2015 Uwe Steinmann
* @ version Release : @ package_version @
*/
class SeedDMS_View_CheckInDocument extends SeedDMS_Bootstrap_Style {
2016-03-21 05:22:01 +00:00
function js () { /* {{{ */
$strictformcheck = $this -> params [ 'strictformcheck' ];
header ( 'Content-Type: application/javascript; charset=UTF-8' );
2016-04-07 17:33:49 +00:00
$this -> printSelectPresetButtonJs ();
2018-02-27 15:12:36 +00:00
$this -> printInputPresetButtonJs ();
$this -> printCheckboxPresetButtonJs ();
2016-03-21 05:22:01 +00:00
?>
function checkForm ()
{
msg = new Array ();
< ? php
if ( $strictformcheck ) {
?>
if ( document . form1 . comment . value == " " ) msg . push ( " <?php printMLText( " js_no_comment " );?> " );
< ? php
}
?>
if ( msg != " " )
{
noty ({
text : msg . join ( '<br />' ),
type : 'error' ,
dismissQueue : true ,
layout : 'topRight' ,
theme : 'defaultTheme' ,
_timeout : 1500 ,
});
return false ;
}
else
return true ;
}
$ ( document ) . ready ( function () {
$ ( 'body' ) . on ( 'submit' , '#form1' , function ( ev ){
if ( checkForm ()) return ;
event . preventDefault ();
});
2018-02-27 15:12:36 +00:00
$ ( '#presetexpdate' ) . on ( 'change' , function ( ev ){
if ( $ ( this ) . val () == 'date' )
$ ( '#control_expdate' ) . show ();
else
$ ( '#control_expdate' ) . hide ();
});
2016-03-21 05:22:01 +00:00
});
< ? php
} /* }}} */
2015-04-22 15:23:54 +00:00
function show () { /* {{{ */
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
$folder = $this -> params [ 'folder' ];
$document = $this -> params [ 'document' ];
$strictformcheck = $this -> params [ 'strictformcheck' ];
$enablelargefileupload = $this -> params [ 'enablelargefileupload' ];
$enableadminrevapp = $this -> params [ 'enableadminrevapp' ];
$enableownerrevapp = $this -> params [ 'enableownerrevapp' ];
$enableselfrevapp = $this -> params [ 'enableselfrevapp' ];
2018-01-16 17:15:05 +00:00
$enableselfreceipt = $this -> params [ 'enableselfreceipt' ];
2018-04-03 07:32:36 +00:00
$enablereceiptworkflow = $this -> params [ 'enablereceiptworkflow' ];
2015-04-22 15:23:54 +00:00
$workflowmode = $this -> params [ 'workflowmode' ];
$presetexpiration = $this -> params [ 'presetexpiration' ];
$documentid = $document -> getId ();
$this -> htmlStartPage ( getMLText ( " document_title " , array ( " documentname " => htmlspecialchars ( $document -> getName ()))));
$this -> globalNavigation ( $folder );
$this -> contentStart ();
$this -> pageNavigation ( $this -> getFolderPathHTML ( $folder , true , $document ), " view_document " , $document );
$this -> contentHeading ( getMLText ( " checkin_document " ));
if ( $document -> isLocked ()) {
$lockingUser = $document -> getLockingUser ();
print " <div class= \" alert alert-warning \" > " ;
printMLText ( " update_locked_msg " , array ( " username " => htmlspecialchars ( $lockingUser -> getFullName ()), " email " => $lockingUser -> getEmail ()));
if ( $lockingUser -> getID () == $user -> getID ())
printMLText ( " unlock_cause_locking_user " );
else if ( $document -> getAccessMode ( $user ) == M_ALL )
printMLText ( " unlock_cause_access_mode_all " );
else
{
printMLText ( " no_update_cause_locked " );
print " </div> " ;
$this -> htmlEndPage ();
exit ;
}
print " </div> " ;
}
if ( $checkoutstatus = $document -> checkOutStatus ()) {
switch ( $checkoutstatus ) {
case 1 :
print " <div class= \" alert alert-warning \" > " ;
printMLText ( " checkedout_file_has_disappeared " );
print " </div> " ;
break ;
case 2 :
print " <div class= \" alert alert-warning \" > " ;
printMLText ( " checkedout_file_has_different_version " );
print " </div> " ;
break ;
case 3 :
print " <div class= \" alert alert-warning \" > " ;
printMLText ( " checkedout_file_is_unchanged " );
print " </div> " ;
break ;
}
}
2015-04-23 14:44:16 +00:00
$checkoutinfo = $document -> getCheckOutInfo ();
if ( $checkoutstatus == 0 ) {
2015-04-22 15:23:54 +00:00
$latestContent = $document -> getLatestContent ();
$reviewStatus = $latestContent -> getReviewStatus ();
$approvalStatus = $latestContent -> getApprovalStatus ();
2018-01-16 17:15:05 +00:00
$receiptStatus = $latestContent -> getReceiptStatus ();
2015-04-22 15:23:54 +00:00
if ( $workflowmode == 'advanced' ) {
if ( $status = $latestContent -> getStatus ()) {
if ( $status [ " status " ] == S_IN_WORKFLOW ) {
$this -> warningMsg ( " The current version of this document is in a workflow. This will be interrupted and cannot be completed if you upload a new version. " );
}
}
}
$this -> contentContainerStart ();
?>
2016-03-21 05:22:01 +00:00
< form action = " ../op/op.CheckInDocument.php " method = " post " id = " form1 " name = " form1 " >
2015-04-22 15:23:54 +00:00
< input type = " hidden " name = " documentid " value = " <?php print $document->getID (); ?> " >
< table class = " table-condensed " >
< tr >
< td >< ? php printMLText ( " comment " ); ?> :</td>
< td class = " standardText " >
2018-02-27 15:12:36 +00:00
< textarea name = " comment " rows = " 4 " cols = " 80 " < ? php echo $strictformcheck ? ' required' : '' ; ?> ></textarea>
2015-04-22 15:23:54 +00:00
</ td >
</ tr >
< ? php
if ( $presetexpiration ) {
if ( ! ( $expts = strtotime ( $presetexpiration )))
2018-02-27 15:12:36 +00:00
$expts = false ;
2015-04-22 15:23:54 +00:00
} else {
2018-02-27 15:12:36 +00:00
$expts = false ;
2015-04-22 15:23:54 +00:00
}
?>
< tr >
2018-02-27 15:12:36 +00:00
< td >< ? php printMLText ( " preset_expires " ); ?> :</td>
< td >
< select class = " span6 " name = " presetexpdate " id = " presetexpdate " >
< option value = " never " >< ? php printMLText ( 'does_not_expire' ); ?> </option>
< option value = " date " < ? php echo ( $expts != '' ? " selected " : " " ); ?> ><?php printMLText('expire_by_date');?></option>
< option value = " 1w " >< ? php printMLText ( 'expire_in_1w' ); ?> </option>
< option value = " 1m " >< ? php printMLText ( 'expire_in_1m' ); ?> </option>
< option value = " 1y " >< ? php printMLText ( 'expire_in_1y' ); ?> </option>
< option value = " 2y " >< ? php printMLText ( 'expire_in_2y' ); ?> </option>
</ select >
</ td >
</ tr >
< tr id = " control_expdate " < ? php echo ( $expts == false ? 'style="display: none;"' : '' ); ?> >
2015-04-22 15:23:54 +00:00
< td >< ? php printMLText ( " expires " ); ?> :</td>
< td class = " standardText " >
2018-02-27 15:12:36 +00:00
< span class = " input-append date span12 " id = " expirationdate " data - date = " <?php echo ( $expts ? date('Y-m-d', $expts ) : ''); ?> " data - date - format = " yyyy-mm-dd " data - date - language = " <?php echo str_replace('_', '-', $this->params ['session']->getLanguage()); ?> " >
< input class = " span3 " size = " 16 " name = " expdate " type = " text " value = " <?php echo ( $expts ? date('Y-m-d', $expts ) : ''); ?> " >
2015-04-22 15:23:54 +00:00
< span class = " add-on " >< i class = " icon-calendar " ></ i ></ span >
2018-02-27 15:12:36 +00:00
</ span >
2015-04-22 15:23:54 +00:00
</ td >
</ tr >
< ? php
$attrdefs = $dms -> getAllAttributeDefinitions ( array ( SeedDMS_Core_AttributeDefinition :: objtype_documentcontent , SeedDMS_Core_AttributeDefinition :: objtype_all ));
if ( $attrdefs ) {
foreach ( $attrdefs as $attrdef ) {
2018-02-27 15:12:36 +00:00
$arr = $this -> callHook ( 'editDocumentContentAttribute' , $document , $attrdef );
if ( is_array ( $arr )) {
if ( $arr ) {
echo " <tr> " ;
echo " <td> " . $arr [ 0 ] . " :</td> " ;
echo " <td> " . $arr [ 1 ] . " </td> " ;
echo " </tr> " ;
}
} else {
2015-04-22 15:23:54 +00:00
?>
< tr >
< td >< ? php echo htmlspecialchars ( $attrdef -> getName ()); ?> :</td>
2018-03-07 16:16:02 +00:00
< td >< ? php $this -> printAttributeEditField ( $attrdef , '' , 'attributes' ) ?>
2018-02-27 15:12:36 +00:00
< ? php
if ( $latestContent -> getAttributeValue ( $attrdef )) {
switch ( $attrdef -> getType ()) {
case SeedDMS_Core_AttributeDefinition :: type_string :
case SeedDMS_Core_AttributeDefinition :: type_date :
case SeedDMS_Core_AttributeDefinition :: type_int :
case SeedDMS_Core_AttributeDefinition :: type_float :
2018-03-07 16:16:02 +00:00
$this -> printInputPresetButtonHtml ( 'attributes_' . $attrdef -> getID (), $latestContent -> getAttributeValue ( $attrdef ), $attrdef -> getValueSetSeparator ());
2018-02-27 15:12:36 +00:00
break ;
case SeedDMS_Core_AttributeDefinition :: type_boolean :
2018-03-07 16:16:02 +00:00
$this -> printCheckboxPresetButtonHtml ( 'attributes_' . $attrdef -> getID (), $latestContent -> getAttributeValue ( $attrdef ));
2018-02-27 15:12:36 +00:00
break ;
}
// print_r($latestContent->getAttributeValue($attrdef));
}
?> </td>
2015-04-22 15:23:54 +00:00
</ tr >
< ? php
2018-02-27 15:12:36 +00:00
}
2015-04-22 15:23:54 +00:00
}
}
if ( $workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval' ) {
// Retrieve a list of all users and groups that have review / approve
// privileges.
$docAccess = $folder -> getReadAccessList ( $enableadminrevapp , $enableownerrevapp );
if ( $workflowmode != 'traditional_only_approval' ) {
?>
< tr >
< td colspan = " 2 " >
< ? php $this -> contentSubHeading ( getMLText ( " assign_reviewers " )); ?>
</ td >
</ tr >
< tr >
< td >
< div class = " cbSelectTitle " >< ? php printMLText ( " individuals " ); ?> :</div>
</ td >
< td >
< select id = " IndReviewer " class = " chzn-select span9 " name = " indReviewers[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_ind_reviewers'); ?> " data - no_results_text = " <?php printMLText('unknown_owner'); ?> " >
< ? php
$res = $user -> getMandatoryReviewers ();
foreach ( $docAccess [ " users " ] as $usr ) {
if ( ! $enableselfrevapp && $usr -> getID () == $user -> getID ()) continue ;
$mandatory = false ;
foreach ( $res as $r ) if ( $r [ 'reviewerUserID' ] == $usr -> getID ()) $mandatory = true ;
if ( $mandatory ) print " <option disabled= \" disabled \" value= \" " . $usr -> getID () . " \" > " . htmlspecialchars ( $usr -> getLogin () . " - " . $usr -> getFullName ()) . " </option> " ;
else print " <option value= \" " . $usr -> getID () . " \" > " . htmlspecialchars ( $usr -> getLogin () . " - " . $usr -> getFullName ()) . " </option> " ;
}
?>
</ select >
< ? php
$tmp = array ();
foreach ( $reviewStatus as $r ) {
2015-06-17 10:21:25 +00:00
if ( $r [ 'type' ] == 0 ) {
if ( $res ) {
$mandatory = false ;
foreach ( $res as $rr )
if ( $rr [ 'reviewerUserID' ] == $r [ 'required' ]) {
$mandatory = true ;
}
if ( ! $mandatory )
$tmp [] = $r [ 'required' ];
} else {
2015-04-22 15:23:54 +00:00
$tmp [] = $r [ 'required' ];
2015-06-17 10:21:25 +00:00
}
2015-04-22 15:23:54 +00:00
}
}
if ( $tmp ) {
2016-04-07 17:33:49 +00:00
$this -> printSelectPresetButtonHtml ( " IndReviewer " , $tmp );
2015-04-22 15:23:54 +00:00
}
/* List all mandatory reviewers */
if ( $res ) {
$tmp = array ();
foreach ( $res as $r ) {
if ( $r [ 'reviewerUserID' ] > 0 ) {
$u = $dms -> getUser ( $r [ 'reviewerUserID' ]);
$tmp [] = htmlspecialchars ( $u -> getFullName () . ' (' . $u -> getLogin () . ')' );
}
}
if ( $tmp ) {
echo '<div class="mandatories"><span>' . getMLText ( 'mandatory_reviewers' ) . ':</span> ' ;
echo implode ( ', ' , $tmp );
echo " </div> \n " ;
}
}
/* Check for mandatory reviewer without access */
foreach ( $res as $r ) {
if ( $r [ 'reviewerUserID' ]) {
$hasAccess = false ;
foreach ( $docAccess [ " users " ] as $usr ) {
if ( $r [ 'reviewerUserID' ] == $usr -> getID ())
$hasAccess = true ;
}
if ( ! $hasAccess ) {
$noAccessUser = $dms -> getUser ( $r [ 'reviewerUserID' ]);
echo " <div class= \" alert alert-warning \" > " . getMLText ( " mandatory_reviewer_no_access " , array ( 'user' => htmlspecialchars ( $noAccessUser -> getFullName () . " ( " . $noAccessUser -> getLogin () . " ) " ))) . " </div> " ;
}
}
}
?>
</ td >
</ tr >
2016-04-07 17:33:49 +00:00
< tr >
< td >
2019-02-01 08:01:18 +00:00
< div class = " cbSelectTitle " >< ? php printMLText ( " individuals_in_groups " ); ?> :</div>
2016-04-07 17:33:49 +00:00
</ td >
< td >
< select class = " chzn-select span9 " name = " grpIndReviewers[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_grp_ind_reviewers'); ?> " >
< ? php
foreach ( $docAccess [ " groups " ] as $grp ) {
print " <option value= \" " . $grp -> getID () . " \" > " . htmlspecialchars ( $grp -> getName ()) . " </option> " ;
}
?>
</ select >
</ td >
</ tr >
2015-04-22 15:23:54 +00:00
< tr >
< td >
< div class = " cbSelectTitle " >< ? php printMLText ( " groups " ); ?> :</div>
</ td >
< td >
< select id = " GrpReviewer " class = " chzn-select span9 " name = " grpReviewers[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_grp_reviewers'); ?> " data - no_results_text = " <?php printMLText('unknown_group'); ?> " >
< ? php
foreach ( $docAccess [ " groups " ] as $grp ) {
$mandatory = false ;
foreach ( $res as $r ) if ( $r [ 'reviewerGroupID' ] == $grp -> getID ()) $mandatory = true ;
2018-03-20 06:25:22 +00:00
if ( $mandatory || ! $grp -> getUsers ()) print " <option value= \" " . $grp -> getID () . " \" disabled= \" disabled \" > " . htmlspecialchars ( $grp -> getName ()) . " </option> " ;
2015-04-22 15:23:54 +00:00
else print " <option value= \" " . $grp -> getID () . " \" > " . htmlspecialchars ( $grp -> getName ()) . " </option> " ;
}
?>
</ select >
< ? php
2015-06-17 10:21:25 +00:00
$tmp = array ();
foreach ( $reviewStatus as $r ) {
if ( $r [ 'type' ] == 1 ) {
if ( $res ) {
$mandatory = false ;
foreach ( $res as $rr )
if ( $rr [ 'reviewerGroupID' ] == $r [ 'required' ]) {
$mandatory = true ;
}
if ( ! $mandatory )
$tmp [] = $r [ 'required' ];
} else {
$tmp [] = $r [ 'required' ];
}
}
}
if ( $tmp ) {
2016-04-07 17:33:49 +00:00
$this -> printSelectPresetButtonHtml ( " GrpReviewer " , $tmp );
2015-06-17 10:21:25 +00:00
}
2015-04-22 15:23:54 +00:00
/* List all mandatory groups of reviewers */
if ( $res ) {
$tmp = array ();
foreach ( $res as $r ) {
if ( $r [ 'reviewerGroupID' ] > 0 ) {
$u = $dms -> getGroup ( $r [ 'reviewerGroupID' ]);
$tmp [] = htmlspecialchars ( $u -> getName ());
}
}
if ( $tmp ) {
echo '<div class="mandatories"><span>' . getMLText ( 'mandatory_reviewergroups' ) . ':</span> ' ;
echo implode ( ', ' , $tmp );
echo " </div> \n " ;
}
}
/* Check for mandatory reviewer group without access */
foreach ( $res as $r ) {
if ( $r [ 'reviewerGroupID' ]) {
$hasAccess = false ;
foreach ( $docAccess [ " groups " ] as $grp ) {
if ( $r [ 'reviewerGroupID' ] == $grp -> getID ())
$hasAccess = true ;
}
if ( ! $hasAccess ) {
$noAccessGroup = $dms -> getGroup ( $r [ 'reviewerGroupID' ]);
echo " <div class= \" alert alert-warning \" > " . getMLText ( " mandatory_reviewergroup_no_access " , array ( 'group' => htmlspecialchars ( $noAccessGroup -> getName ()))) . " </div> " ;
}
}
}
?>
</ td >
</ tr >
< ? php } ?>
< tr >
< td colspan = 2 >
< ? php $this -> contentSubHeading ( getMLText ( " assign_approvers " )); ?>
</ td >
</ tr >
< tr >
< td >
< div class = " cbSelectTitle " >< ? php printMLText ( " individuals " ); ?> :</div>
</ td >
< td >
< select id = " IndApprover " class = " chzn-select span9 " name = " indApprovers[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_ind_approvers'); ?> " data - no_results_text = " <?php printMLText('unknown_owner'); ?> " >
< ? php
$res = $user -> getMandatoryApprovers ();
foreach ( $docAccess [ " users " ] as $usr ) {
if ( ! $enableselfrevapp && $usr -> getID () == $user -> getID ()) continue ;
$mandatory = false ;
foreach ( $res as $r ) if ( $r [ 'approverUserID' ] == $usr -> getID ()) $mandatory = true ;
if ( $mandatory ) print " <option value= \" " . $usr -> getID () . " \" disabled='disabled'> " . htmlspecialchars ( $usr -> getFullName ()) . " </option> " ;
else print " <option value= \" " . $usr -> getID () . " \" > " . htmlspecialchars ( $usr -> getLogin () . " - " . $usr -> getFullName ()) . " </option> " ;
}
?>
</ select >
< ? php
$tmp = array ();
foreach ( $approvalStatus as $r ) {
2015-06-17 10:21:25 +00:00
if ( $r [ 'type' ] == 0 ) {
if ( $res ) {
$mandatory = false ;
foreach ( $res as $rr )
if ( $rr [ 'approverUserID' ] == $r [ 'required' ]) {
$mandatory = true ;
}
if ( ! $mandatory )
$tmp [] = $r [ 'required' ];
} else {
2015-04-22 15:23:54 +00:00
$tmp [] = $r [ 'required' ];
2015-06-17 10:21:25 +00:00
}
2015-04-22 15:23:54 +00:00
}
}
if ( $tmp ) {
2016-04-07 17:33:49 +00:00
$this -> printSelectPresetButtonHtml ( " IndApprover " , $tmp );
2015-04-22 15:23:54 +00:00
}
/* List all mandatory approvers */
if ( $res ) {
$tmp = array ();
foreach ( $res as $r ) {
if ( $r [ 'approverUserID' ] > 0 ) {
$u = $dms -> getUser ( $r [ 'approverUserID' ]);
$tmp [] = htmlspecialchars ( $u -> getFullName () . ' (' . $u -> getLogin () . ')' );
}
}
if ( $tmp ) {
echo '<div class="mandatories"><span>' . getMLText ( 'mandatory_approvers' ) . ':</span> ' ;
echo implode ( ', ' , $tmp );
echo " </div> \n " ;
}
}
/* Check for mandatory approvers without access */
foreach ( $res as $r ) {
if ( $r [ 'approverUserID' ]) {
$hasAccess = false ;
foreach ( $docAccess [ " users " ] as $usr ) {
if ( $r [ 'approverUserID' ] == $usr -> getID ())
$hasAccess = true ;
}
if ( ! $hasAccess ) {
$noAccessUser = $dms -> getUser ( $r [ 'approverUserID' ]);
echo " <div class= \" alert alert-warning \" > " . getMLText ( " mandatory_approver_no_access " , array ( 'user' => htmlspecialchars ( $noAccessUser -> getFullName () . " ( " . $noAccessUser -> getLogin () . " ) " ))) . " </div> " ;
}
}
}
?>
</ td >
2016-04-07 17:33:49 +00:00
</ tr >
< tr >
< td >
2019-02-01 08:01:18 +00:00
< div class = " cbSelectTitle " >< ? php printMLText ( " individuals_in_groups " ); ?> :</div>
2016-04-07 17:33:49 +00:00
</ td >
< td >
< select class = " chzn-select span9 " name = " grpIndApprovers[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_grp_ind_approvers'); ?> " >
< ? php
foreach ( $docAccess [ " groups " ] as $grp ) {
print " <option value= \" " . $grp -> getID () . " \" > " . htmlspecialchars ( $grp -> getName ()) . " </option> " ;
}
?>
</ select >
</ td >
</ tr >
< tr >
2015-04-22 15:23:54 +00:00
< td >
< div class = " cbSelectTitle " >< ? php printMLText ( " groups " ); ?> :</div>
</ td >
< td >
< select id = " GrpApprover " class = " chzn-select span9 " name = " grpApprovers[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_grp_approvers'); ?> " data - no_results_text = " <?php printMLText('unknown_group'); ?> " >
< ? php
foreach ( $docAccess [ " groups " ] as $grp ) {
$mandatory = false ;
foreach ( $res as $r ) if ( $r [ 'approverGroupID' ] == $grp -> getID ()) $mandatory = true ;
2018-03-20 06:25:22 +00:00
if ( $mandatory || ! $grp -> getUsers ()) print " <option value= \" " . $grp -> getID () . " \" disabled= \" disabled \" > " . htmlspecialchars ( $grp -> getName ()) . " </option> " ;
2015-04-22 15:23:54 +00:00
else print " <option value= \" " . $grp -> getID () . " \" > " . htmlspecialchars ( $grp -> getName ()) . " </option> " ;
}
?>
</ select >
< ? php
$tmp = array ();
foreach ( $approvalStatus as $r ) {
2015-06-17 10:21:25 +00:00
if ( $r [ 'type' ] == 1 ) {
if ( $res ) {
$mandatory = false ;
foreach ( $res as $rr )
if ( $rr [ 'approverGroupID' ] == $r [ 'required' ]) {
$mandatory = true ;
}
if ( ! $mandatory )
$tmp [] = $r [ 'required' ];
} else {
2015-04-22 15:23:54 +00:00
$tmp [] = $r [ 'required' ];
2015-06-17 10:21:25 +00:00
}
2015-04-22 15:23:54 +00:00
}
}
if ( $tmp ) {
2016-04-07 17:33:49 +00:00
$this -> printSelectPresetButtonHtml ( " GrpApprover " , $tmp );
2015-04-22 15:23:54 +00:00
}
/* List all mandatory groups of approvers */
if ( $res ) {
$tmp = array ();
foreach ( $res as $r ) {
if ( $r [ 'approverGroupID' ] > 0 ) {
$u = $dms -> getGroup ( $r [ 'approverGroupID' ]);
$tmp [] = htmlspecialchars ( $u -> getName ());
}
}
if ( $tmp ) {
echo '<div class="mandatories"><span>' . getMLText ( 'mandatory_approvergroups' ) . ':</span> ' ;
echo implode ( ', ' , $tmp );
echo " </div> \n " ;
}
}
/* Check for mandatory approver groups without access */
foreach ( $res as $r ) {
if ( $r [ 'approverGroupID' ]) {
$hasAccess = false ;
foreach ( $docAccess [ " groups " ] as $grp ) {
if ( $r [ 'approverGroupID' ] == $grp -> getID ())
$hasAccess = true ;
}
if ( ! $hasAccess ) {
$noAccessGroup = $dms -> getGroup ( $r [ 'approverGroupID' ]);
echo " <div class= \" alert alert-warning \" > " . getMLText ( " mandatory_approvergroup_no_access " , array ( 'group' => htmlspecialchars ( $noAccessGroup -> getName ()))) . " </div> " ;
}
}
}
?>
</ td >
</ tr >
< tr >
< td colspan = " 2 " >< div class = " alert " >< ? php printMLText ( " add_doc_reviewer_approver_warning " ) ?> </div></td>
</ tr >
< ? php
} else {
?>
< tr >
< td >
< div class = " cbSelectTitle " >< ? php printMLText ( " workflow " ); ?> :</div>
</ td >
< td >
< ? php
$mandatoryworkflow = $user -> getMandatoryWorkflow ();
if ( $mandatoryworkflow ) {
?>
< ? php echo $mandatoryworkflow -> getName (); ?>
< input type = " hidden " name = " workflow " value = " <?php echo $mandatoryworkflow->getID (); ?> " >
< ? php
} else {
?>
< select class = " _chzn-select-deselect span9 " name = " workflow " data - placeholder = " <?php printMLText('select_workflow'); ?> " >
< ? php
$workflows = $dms -> getAllWorkflows ();
print " <option value= \" \" > " . " </option> " ;
foreach ( $workflows as $workflow ) {
print " <option value= \" " . $workflow -> getID () . " \" " ;
if ( $mandatoryworkflow && $mandatoryworkflow -> getID () == $workflow -> getID ())
echo " selected= \" selected \" " ;
print " > " . htmlspecialchars ( $workflow -> getName ()) . " </option> " ;
}
?>
</ select >
< ? php
}
?>
</ td >
</ tr >
< tr >
< td colspan = " 2 " >
< ? php $this -> warningMsg ( getMLText ( " add_doc_workflow_warning " )); ?>
</ td >
</ tr >
< ? php
}
2018-04-03 07:32:36 +00:00
if ( $enablereceiptworkflow ) {
2015-04-22 15:23:54 +00:00
?>
2018-01-16 17:15:05 +00:00
< tr >
< td colspan = " 2 " >
2018-01-21 12:58:49 +00:00
< ? php $this -> contentSubHeading ( getMLText ( " assign_recipients " )); ?>
2018-01-16 17:15:05 +00:00
</ td >
</ tr >
< tr >
< td >
< div class = " cbSelectTitle " >< ? php printMLText ( " individuals " ); ?> :</div>
</ td >
< td >
< select id = " IndRecipient " class = " chzn-select span9 " name = " indRecipients[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_ind_recipients'); ?> " data - no_results_text = " <?php printMLText('unknown_owner'); ?> " >
< ? php
foreach ( $docAccess [ " users " ] as $usr ) {
if ( ! $enableselfreceipt && $usr -> getID () == $user -> getID ()) continue ;
print " <option value= \" " . $usr -> getID () . " \" > " . htmlspecialchars ( $usr -> getLogin () . " - " . $usr -> getFullName ()) . " </option> " ;
}
?>
</ select >
< ? php
$tmp = array ();
foreach ( $receiptStatus as $r ) {
if ( $r [ 'type' ] == 0 ) {
$tmp [] = $r [ 'required' ];
}
}
if ( $tmp ) {
$this -> printSelectPresetButtonHtml ( " IndRecipient " , $tmp );
}
?>
</ td >
</ tr >
< tr >
< td >
2019-02-01 08:01:18 +00:00
< div class = " cbSelectTitle " >< ? php printMLText ( " individuals_in_groups " ); ?> :</div>
2018-01-16 17:15:05 +00:00
</ td >
< td >
< select class = " chzn-select span9 " name = " grpIndRecipients[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_grp_ind_recipients'); ?> " >
< ? php
foreach ( $docAccess [ " groups " ] as $grp ) {
print " <option value= \" " . $grp -> getID () . " \" > " . htmlspecialchars ( $grp -> getName ()) . " </option> " ;
}
?>
</ select >
</ td >
</ tr >
< tr >
< td >
< div class = " cbSelectTitle " >< ? php printMLText ( " groups " ); ?> :</div>
</ td >
< td >
< select id = " GrpRecipient " class = " chzn-select span9 " name = " grpRecipients[] " multiple = " multiple " data - placeholder = " <?php printMLText('select_grp_recipients'); ?> " data - no_results_text = " <?php printMLText('unknown_group'); ?> " >
< ? php
foreach ( $docAccess [ " groups " ] as $grp ) {
print " <option value= \" " . $grp -> getID () . " \" > " . htmlspecialchars ( $grp -> getName ()) . " </option> " ;
}
?>
</ select >
< ? php
$tmp = array ();
foreach ( $receiptStatus as $r ) {
if ( $r [ 'type' ] == 1 ) {
$tmp [] = $r [ 'required' ];
}
}
if ( $tmp ) {
$this -> printSelectPresetButtonHtml ( " GrpRecipient " , $tmp );
}
?>
</ td >
</ tr >
2018-04-03 07:32:36 +00:00
< ? php
}
?>
2015-04-22 15:23:54 +00:00
< tr >
< td ></ td >
2015-04-23 14:44:16 +00:00
< td >< input type = " submit " class = " btn " value = " <?php printMLText( " checkin_document " )?> " ></ td >
2015-04-22 15:23:54 +00:00
</ tr >
</ table >
</ form >
< ? php
$this -> contentContainerEnd ();
2015-04-23 14:44:16 +00:00
} else {
?>
2016-03-21 06:46:55 +00:00
< form action = " ../op/op.CheckInDocument.php " method = " post " >
2015-04-23 14:44:16 +00:00
< input type = " hidden " name = " documentid " value = " <?php print $document->getID (); ?> " >
< input type = " submit " class = " btn " value = " <?php printMLText( " reset_checkout " ); ?> " >
2016-03-21 06:46:55 +00:00
</ form >
2015-04-23 14:44:16 +00:00
< ? php
}
2016-03-21 05:22:01 +00:00
$this -> contentEnd ();
2015-04-22 15:23:54 +00:00
$this -> htmlEndPage ();
} /* }}} */
}
?>